Skip to content

Commit

Permalink
added notes about mountable Rack cells in the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Dec 21, 2011
1 parent c3f3b51 commit c60ead2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CHANGES.textile
@@ -1,12 +1,12 @@
h2. 3.8.0

* @Cell::Base@ got rid of the controller dependency. If you want the @ActionController@ instance around in your cell, use @Cell::Rails@ - this should be the default in a standard Rails setup. However, if you plan on using a Cell in a Rack middleware or don't need the controller, use @Cell::Base@.
* New API (note that `controller` isn't the first argument anymore):
* @Rails.create_cell_for(name, controller)@
* @Rails.render_cell_for(name, state, controller, *args)@
* New API (note that @controller@ isn't the first argument anymore):
** @Rails.create_cell_for(name, controller)@
** @Rails.render_cell_for(name, state, controller, *args)@
* Moved builder methods to @Cell::Builder@ module.
* @DEFAULT_VIEW_PATHS@ is now in @Cell::Base@.
* Removed the monkey-patch to make state-args work in Rails <= 3.0.3. Upgrade to +3.0.4.
* Removed the monkey-patch that made state-args work in Rails <= 3.0.3. Upgrade to +3.0.4.

h2. 3.7.1

Expand Down
13 changes: 13 additions & 0 deletions README.rdoc
Expand Up @@ -173,6 +173,19 @@ To run your specs we got a rake task, too!
$ rake spec:cells


== Mountable Cells

Cells 3.8 got rid of the ActionController dependency. This essentially means you can mount Cells to routes or use them like a Rack middleware. All you need to do is derive from @Cell::Base@.

class PostCell < Cell::Base
..

In your @routes.rb@ file, mount the cell like a Rack app.

match "/posts" => proc { |env|
[ 200, {}, [ Cell::Base.render_cell_for(:post, :show) ]]
}

== Rails 2.3 note

In order to copy the cells rake tasks to your app, run
Expand Down

0 comments on commit c60ead2

Please sign in to comment.