Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.