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 HTML 

It is.

> what is the practical
> difference?

The URL calculation is a big difference.

> 
> thanks

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to