Skip to content

invisiblefunnel/view_accessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ViewAccessor

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.

Install

gem 'view_accessor', github: 'invisiblefunnel/view_accessor'

Usage

class WidgetsController < ApplicationController
  view_accessor :widgets

  def index
    self.widgets = Widget.all
  end
end
<div class="widgets">
  <%= render widgets %>
</div>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

An alternative method of sharing state between Rails controllers and views.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages