I have this in a template-> Hello <% form_tag :action => "create" do %> My pretty form! <% end %> And all I''m getting at output is -> Hello Actually, any actionview helper that is supposed to take a code block is not working for me. What wicked stupid thing am I missing here? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Hello > <% form_tag :action => "create" do %> > My pretty form! > <% end %>you need to use <%= on the form tag even if you use the block method -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for the reply! Sadly, though, I tried that. Error-> compile error C:/INSTAN~1/rails_apps/lumina_erp/config/../app/views/bom_lines/ edit.rhtml:2: parse error, unexpected '')'' _erbout.concat(( form_tag :action => "create" do ).to_s); _erbout.concat "\n" ^ C:/INSTAN~1/rails_apps/lumina_erp/config/../app/views/bom_lines/ edit.rhtml:5: parse error, unexpected kEND, expecting '')'' Obvioulsy from the error message you can see that this is on a M$ machine (InstantRails 1.4 WinXP). Anyways, just tried it on Ubuntu server and it works fine. Must be a problem with InstantRails. So to recap... The first way I posted (and that''s all over api.rubyonrails.org) is correct. I''m gonna try and update activeview through gem now I guess. Thanks for your help! On Feb 16, 4:20 pm, Keynan Pratt <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hello > > <% form_tag :action => "create" do %> > > My pretty form! > > <% end %> > > you need to use <%= on the form tag even if you use the block method > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
julian wrote:> I have this in a template-> > > Hello > <% form_tag :action => "create" do %> > My pretty form! > <% end %> > > And all I''m getting at output is -> > > Hello > > Actually, any actionview helper that is supposed to take a code block > is not working for me. What wicked stupid thing am I missing here?This format require rails 1.2. If you are on 1.1.6 you have to use: <%= form_tag :action => ''create'' %> Form! <%= end_form_tag %> And you can never use blocks with <%= %> with ERb because of the way ERb is evaluated within the blocks. This will always yield an error. What does <%= end %> output in this context? <%= foo do %> <%= ''foo'' %> <%= end %> Only way to do this is: <% foo do %> <%= ''foo'' %> <% end %> But if you want to do form tags with blocks you use 1.2. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Have you tried adding form fields to the form tag? i.e. Hello <% form_tag :action => "create" do %> <p>My pretty form!</p> <p><%= text_field "foo", "bar" %></p> <p><%= submit_tag "Do it!" %></p> <% end %> Also when you said it only outputted Hello was that what you saw rendered in the browser or was that the source of the output? Niels On Feb 16, 2007, at 4:12 PM, julian wrote:> > I have this in a template-> > > Hello > <% form_tag :action => "create" do %> > My pretty form! > <% end %> > > And all I''m getting at output is -> > > Hello > > Actually, any actionview helper that is supposed to take a code block > is not working for me. What wicked stupid thing am I missing here? > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---