<%= content_for :footer %> is mentioned in the docs (capture_helper.rb: 121), but is not valid at this point. I provided a simple patch below, but there should probably be some discussion. http://dev.rubyonrails.org/ticket/11402 Any thoughts on how these two instances should be treated differently? <% content_for :footer, @footer_content %> vs. <%= content_for :footer, @footer_content %> I have a more thorough exploration in the ticket. Stephen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Sat, Mar 22, 2008 at 9:27 AM, stephen.celis@gmail.com <stephen.celis@gmail.com> wrote:> > <%= content_for :footer %> is mentioned in the docs (capture_helper.rb: > 121), but is not valid at this point. I provided a simple patch below, > but there should probably be some discussion. > > http://dev.rubyonrails.org/ticket/11402 > > Any thoughts on how these two instances should be treated differently? > <% content_for :footer, @footer_content %> vs. > <%= content_for :footer, @footer_content %> > > I have a more thorough exploration in the ticket.Perhaps that''s just a typo in the docs? I always thought content_for stuffed the data in a @content_for_* ivar for use elsewhere in the template or layout. I don''t think it should also output the data. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah, I mentioned the possibility of a typo in the ticket, which would somewhat resolve things, though the behavior still isn''t completely clear in the documentation: I can especially see people new to the framework making mistakes with <%=. Stephen On Mar 22, 2:16 pm, "Rick Olson" <technowee...@gmail.com> wrote:> On Sat, Mar 22, 2008 at 9:27 AM, stephen.ce...@gmail.com > > <stephen.ce...@gmail.com> wrote: > > > <%= content_for :footer %> is mentioned in the docs (capture_helper.rb: > > 121), but is not valid at this point. I provided a simple patch below, > > but there should probably be some discussion. > > > http://dev.rubyonrails.org/ticket/11402 > > > Any thoughts on how these two instances should be treated differently? > > <% content_for :footer, @footer_content %> vs. > > <%= content_for :footer, @footer_content %> > > > I have a more thorough exploration in the ticket. > > Perhaps that''s just a typo in the docs? I always thought content_for > stuffed the data in a @content_for_* ivar for use elsewhere in the > template or layout. I don''t think it should also output the data. > > -- > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Aren''t you meant to use: <%= yield :footer -%> In order to get anything you''ve stored in <% content_for(:footer) -%> out? Or am I missing the point? On Sun, Mar 23, 2008 at 8:43 AM, Stephen Celis <stephen.celis@gmail.com> wrote:> > Yeah, I mentioned the possibility of a typo in the ticket, which would > somewhat resolve things, though the behavior still isn''t completely > clear in the documentation: I can especially see people new to the > framework making mistakes with <%=. > > Stephen > > On Mar 22, 2:16 pm, "Rick Olson" <technowee...@gmail.com> wrote: > > On Sat, Mar 22, 2008 at 9:27 AM, stephen.ce...@gmail.com > > > > > <stephen.ce...@gmail.com> wrote: > > > > > <%= content_for :footer %> is mentioned in the docs (capture_helper.rb: > > > 121), but is not valid at this point. I provided a simple patch below, > > > but there should probably be some discussion. > > > > > http://dev.rubyonrails.org/ticket/11402 > > > > > Any thoughts on how these two instances should be treated differently? > > > <% content_for :footer, @footer_content %> vs. > > > <%= content_for :footer, @footer_content %> > > > > > I have a more thorough exploration in the ticket. > > > > Perhaps that''s just a typo in the docs? I always thought content_for > > stuffed the data in a @content_for_* ivar for use elsewhere in the > > template or layout. I don''t think it should also output the data. > > > > -- > > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.com > > > > >-- Nik Wakelin munkywrench@gmail.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Yes, you are meant to do so, but the documentation is confusing in the discussion of declaring that content to begin with. This especially: <%= content_for :footer %> Two problems: 1. Uses an "=" ERB tag. 2. Doesn''t declare any content. On Mar 22, 4:24 pm, "Nik Wakelin" <munkywre...@gmail.com> wrote:> Aren''t you meant to use: > > <%= yield :footer -%> > > In order to get anything you''ve stored in <% content_for(:footer) -%> out? > > Or am I missing the point? > > > > On Sun, Mar 23, 2008 at 8:43 AM, Stephen Celis <stephen.ce...@gmail.com> wrote: > > > Yeah, I mentioned the possibility of a typo in the ticket, which would > > somewhat resolve things, though the behavior still isn''t completely > > clear in the documentation: I can especially see people new to the > > framework making mistakes with <%=. > > > Stephen > > > On Mar 22, 2:16 pm, "Rick Olson" <technowee...@gmail.com> wrote: > > > On Sat, Mar 22, 2008 at 9:27 AM, stephen.ce...@gmail.com > > > > <stephen.ce...@gmail.com> wrote: > > > > > <%= content_for :footer %> is mentioned in the docs (capture_helper.rb: > > > > 121), but is not valid at this point. I provided a simple patch below, > > > > but there should probably be some discussion. > > > > > http://dev.rubyonrails.org/ticket/11402 > > > > > Any thoughts on how these two instances should be treated differently? > > > > <% content_for :footer, @footer_content %> vs. > > > > <%= content_for :footer, @footer_content %> > > > > > I have a more thorough exploration in the ticket. > > > > Perhaps that''s just a typo in the docs? I always thought content_for > > > stuffed the data in a @content_for_* ivar for use elsewhere in the > > > template or layout. I don''t think it should also output the data. > > > > -- > > > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephist... > > -- > Nik Wakelin > munkywre...@gmail.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---