Wild::Views

Wild views allows you use easily your views from a remote server

Installation

Add this line to your application's Gemfile:

gem 'wild-views'

And then execute:

$ bundle

After the gem installed, execute:

$ rails g wild:views:install

Configuration

You should configure your views endpoint in config/wild_views.yml, by default wild_views will use VIEWS_ENDPOINT environment:

default: &default
  endpoint: <%= ENV.fetch('VIEWS_ENDPOINT') %>

development:
  <<: *default

test:
  <<: *default

production:
  <<: *default

Being wild

Now on your view you can set remote: true to request the template from your views service:

<%= render partial: 'components/loading', remote: true

This code you make the follow http request, given the Wild::View.endpoint as 'http://templates.myapp.com':

GET "http://templates.myapp.com/components/loading"

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/wild-views. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.