Apparently inside a helper form_remote_tag cannot take a block because _erbout is out of scope. As of a year ago the accepted way to handle this was to call form_remote_tag without a block, like this; form_remote_tag(:url => { :controller => stuf } ) + submit_tag(button_text) + end_form_tag Now end_form_tag is deprecated, and we are supposed to use blocks instead. Actually, the method no longer exists, so I guess it is not even deprecated anymore. Regardless, can I just replace end_form_tag with "</form>" or does the method do more then that? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It would be like this: <% form_remote_tag :url => {:controller => stuf} do %> <%= submit_tag(button_text) %> <% end %> On Sat, Oct 11, 2008 at 9:47 AM, Garrett Berneche <punkrockdontcare-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Apparently inside a helper form_remote_tag cannot take a block because > _erbout is out of scope. As of a year ago the accepted way to handle > this was to call form_remote_tag without a block, like this; > > form_remote_tag(:url => { :controller => stuf } ) + > submit_tag(button_text) + > end_form_tag > > > Now end_form_tag is deprecated, and we are supposed to use blocks > instead. Actually, the method no longer exists, so I guess it is not > even deprecated anymore. Regardless, can I just replace end_form_tag > with "</form>" or does the method do more then that?-- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That doesn''t work. When you are in a helper instead of a view form_remote_tag cannot except a block because _erbout is out of scope. On Oct 11, 10:04 am, "Maurício Linhares" <mauricio.linha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It would be like this: > > <% form_remote_tag :url => {:controller => stuf} do %> > <%= submit_tag(button_text) %> > <% end %> > > On Sat, Oct 11, 2008 at 9:47 AM, Garrett Berneche > > <punkrockdontc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Apparently inside a helper form_remote_tag cannot take a block because > > _erbout is out of scope. As of a year ago the accepted way to handle > > this was to call form_remote_tag without a block, like this; > > > form_remote_tag(:url => { :controller => stuf } ) + > > submit_tag(button_text) + > > end_form_tag > > > Now end_form_tag is deprecated, and we are supposed to use blocks > > instead. Actually, the method no longer exists, so I guess it is not > > even deprecated anymore. Regardless, can I just replace end_form_tag > > with "</form>" or does the method do more then that? > > -- > Maurício Linhareshttp://alinhavado.wordpress.com/(pt-br) |http://blog.codevader.com/(en) > João Pessoa, PB, +55 83 8867-7208--~--~---------~--~----~------------~-------~--~----~ 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 11 Oct 2008, at 13:47, Garrett Berneche wrote:> > Apparently inside a helper form_remote_tag cannot take a block because > _erbout is out of scope. As of a year ago the accepted way to handle > this was to call form_remote_tag without a block, like this; > > form_remote_tag(:url => { :controller => stuf } ) + > submit_tag(button_text) + > end_form_tag > > > Now end_form_tag is deprecated, and we are supposed to use blocks > instead. Actually, the method no longer exists, so I guess it is not > even deprecated anymore. Regardless, can I just replace end_form_tag > with "</form>" or does the method do more then that?end_form_tag just generated ''</form>'' IIRC on edge (soon to be 2.2) all that _erbout stuff was removed, so you might find that these problems mostly go away. Fred> > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---