https://github.com/tylerrick/cells-capture
Provides helpers that allow your cell views to communicate with the view that rendered the cell
https://github.com/tylerrick/cells-capture
Last synced: 6 days ago
JSON representation
Provides helpers that allow your cell views to communicate with the view that rendered the cell
- Host: GitHub
- URL: https://github.com/tylerrick/cells-capture
- Owner: TylerRick
- Created: 2011-03-21T19:35:35.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-03-21T19:55:13.000Z (over 15 years ago)
- Last Synced: 2026-02-15T06:14:16.163Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 168 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme
Awesome Lists containing this project
README
= Cells Capture helpers
== Intro
This adds some helpers to Cells .
Example:
app/cells/capture_test/display.html.erb
<% outer_content_for :greetings do %>
Hello world!
<% end %>
If you then render this cell from a view (doesn't work from a controller because it requires the view context), say like this:
app/views/home/index.html.erb
<%= render_cell :capture_test, :display %>
This executes #content_for in the context of the outer ActionView view context. The captured markup can then be accessed in your outer action view or in your layout, like this:
app/views/layouts/application.html.erb:
<%= content_for :greetings %>
== Known issues
It appears that the markup within the outer_content_for block in your cell view appends that markup to your cell view instead of simply capturing it. This is a serious problem and I'm not sure why it is happening.
== History
See the comments on https://github.com/TylerRick/cells/commit/b06def3f6d37011d7ababd527e57e65aadbe08a1