search for: _content_for

Displaying 2 results from an estimated 2 matches for "_content_for".

Did you mean: content_for
2010 May 05
2
Add method to get at captured content_for
...get for content captured with the content_for method in a view is to call yield from within a view. However, sometimes is it useful to get to this data from within a helper (for instance to provide a default value). Calling yield from within the helper method won''t work, and accessing the @_content_for variable directly is not encouraged. Proposed solution: add a captured_content_for method so helper methods can legitimately access captured content. Add to /action_pack/lib/ action_view/helpers/capture_helper.rb # Get content previously captured with +content_for+. This is the same as calling...
2010 Aug 18
2
RSpec 2/Rails 3 - content_for in view specs
My main layout includes separate content_for/yield sections for my header, sidebar, footer, and content. However, when running a view spec, the `rendered` variable seems to only contain a string of just the primary content and ignores the header/footer/sidebar as well as the rest of my layout file (the "render" call just returns my primary content wrapped in generic <html> and