I am just learning ruby on rails, i have known HTML for a few years now and i dont really see how the HTML control shortcuts in Erb are shortcuts they just seem to be a different way of creating an HTML control not a shortcut. I mean look at these two form tags does the first one seem like a shortcut? Maybe that is just the opinion of the author of the book i am reading i dont know, am i missing something? Thanks <%= start_form_tag ({:action => "at"}, {:method => "post"}) %> <%= end_form_tag %> <form action = "/look/at" method = "post" </form> -- 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 -~----------~----~----~----~------~----~------~--~---
Corey, That is the older deprecated way. The new way is: <% form_tag :action => ''create'' do %> ... <% end %> Hope this helps. -- Zack Chandler http://depixelate.com On 3/20/07, Corey Konrad <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am just learning ruby on rails, i have known HTML for a few years now > and i dont really see how the HTML control shortcuts in Erb are > shortcuts they just seem to be a different way of creating an HTML > control not a shortcut. > > I mean look at these two form tags does the first one seem like a > shortcut? Maybe that is just the opinion of the author of the book i am > reading i dont know, am i missing something? Thanks > > <%= start_form_tag ({:action => "at"}, {:method => "post"}) %> > <%= end_form_tag %> > > <form action = "/look/at" method = "post" > </form> > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Zack Chandler wrote:> Corey, > > That is the older deprecated way. The new way is: > > <% form_tag :action => ''create'' do %> > ... > <% end %> > > Hope this helps. > > -- > Zack Chandler > http://depixelate.comOk thanks, i still dont see how that new way is a shortcut though, why not just use the normal HTML way? does the form_tag above do something different than the normal HTML <form> tag? It just seems like a way of using ruby to create a form instead of HTML what is the practical difference? thanks -- 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 -~----------~----~----~----~------~----~------~--~---
Corey Konrad wrote:> Zack Chandler wrote: >> Corey, >> >> That is the older deprecated way. The new way is: >> >> <% form_tag :action => ''create'' do %> >> ... >> <% end %> >> >> Hope this helps. >> >> -- >> Zack Chandler >> http://depixelate.com > > Ok thanks, i still dont see how that new way is a shortcut though, why > not just use the normal HTML way? does the form_tag above do something > different than the normal HTML <form> tag? It just seems like a way of > using ruby to create a form instead of HTML what is the practical > difference? > > thanksDear Zack and Corey, I am in the same boat as Corey. Don''t see much of a shorcut but definitely see a whole lot of confusion. The documentation that i have read so far does not seem to be make it better. In fact, I tried running this code with Rails on Ruby 1.8.6-p383 and got eyeful of complains from the firefox and IE. This after using the old deprecated way and the new way. Is there any documentation that explains all this very well? Appreciate any help here. Thank you Muru -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Corey Konrad wrote:> Zack Chandler wrote: >> Corey, >> >> That is the older deprecated way. The new way is: >> >> <% form_tag :action => ''create'' do %> >> ... >> <% end %> >> >> Hope this helps. >> >> -- >> Zack Chandler >> http://depixelate.com > > Ok thanks, i still dont see how that new way is a shortcut though, why > not just use the normal HTML way? does the form_tag above do something > different than the normal HTML <form> tag?Yes. It calculates the URL for the form from the controller and action, which is a big help since Rails doesn''t use direct URLs much. In addition, if you use form_for, it also creates a FormBuilder object so you can use Rails'' helpers for form elements, which automatically pick up values from the object. .> It just seems like a way of > using ruby to create a form instead of HTMLIt is.> what is the practical > difference?The URL calculation is a big difference.> > thanksBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Dec 28, 4:31 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Yes. It calculates the URL for the form from the controller and action, > which is a big help since Rails doesn''t use direct URLs much. In > addition, if you use form_for, it also creates a FormBuilder object so > you can use Rails'' helpers for form elements, which automatically pick > up values from the object. . >And with form_for rails works out for you whether the form''s action should be the url for saving or updating the form etc. It''s true that <%= start_form_tag ({:action => "at"}, {:method => "post"}) %> <%= end_form_tag %> is not very different from <form action = "/look/at" method = "post" </form> but <% form_for @person do |f| %> <%= f.label :name %>: <%= f.text_field :name%> <% end %> is less cumbersome than the alternative. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.