I was just reading the documentation for "form_for" and I noticed that it said: "Worth noting is that the form_for tag is called in a ERb evaluation block, not an ERb output block." Being a curious sort of guy, I wonder how this works... If it''s not in an output block, how does the appropriate markup get rendered? If I wanted to figure this out myself, where would I look? --wpd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000920 The reason it says that is because contrary to what would seem "normal" in rails at first glance, since the form_for tag outputs Markup, you would put <%= %> around it. Since it''s an Block however, it''s just <% %> with a closing <% end %> That''s all the note is making you aware of. On Mar 18, 5:11 pm, "Patrick Doyle" <wpds...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I was just reading the documentation for "form_for" and I noticed that > it said: "Worth noting is that the form_for tag is called in a ERb > evaluation block, not an ERb output block." > > Being a curious sort of guy, I wonder how this works... > If it''s not in an output block, how does the appropriate markup get rendered? > If I wanted to figure this out myself, where would I look? > > --wpd--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Mar 18, 2008 at 5:19 PM, sw0rdfish <santia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000920 > > The reason it says that is because contrary to what would seem > "normal" in rails at first glance, since the form_for tag outputs > Markup, you would put <%= %> around it. Since it''s an Block however, > it''s just <% %> with a closing <% end %> > > That''s all the note is making you aware of.Yes, I understood the note. I''m just curious... How does form_for _do_ that? --wpd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Oh, now I see it... form_for calls concat(sometext, binding) which is the equivalent, through some sort of Ruby/ERb magic to <%= sometext %>. OK, curiosity bump satisfied... now back to my regularly scheduled program. --wpd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---