This repo is an experiment and strays from the standard Rails way.
An alternative method of sharing state between Rails controllers and views. This library is directly inspired this example written by Andrew France. The tests are inspired by decent_exposure.
gem 'view_accessor', github: 'invisiblefunnel/view_accessor'
class WidgetsController < ApplicationController
view_accessor :widgets
def index
self.widgets = Widget.all
end
end
<div class="widgets">
<%= render widgets %>
</div>
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request