Forum: Ruby on Rails form_for v/s field_for

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Virendra N. (Guest)
on 2009-05-25 10:44
Hello
I am trying to use complex-form in my application for which i have to
use field_for i want to know exactly the main difference of form_for and
field_for

and the logic behind field_for

thanks anyway
Julian L. (Guest)
on 2009-05-25 11:05
(Received via mailing list)
On 25/05/2009, at 4:44 PM, Virendra N. wrote:

>
> Hello
> I am trying to use complex-form in my application for which i have to
> use field_for i want to know exactly the main difference of form_for
> and
> field_for
>
> and the logic behind field_for
>
> thanks anyway

They're different classes of thing.

The relationship between forms and fields on web pages is very similar
to that of tables and fields in databases.

Julian.

----------------------------------------------
Blog: http://random8.zenunit.com/
Twitter: http://twitter.com/random8r
Learn: http://sensei.zenunit.com/
Latest: How to use Unix basics at http://sensei.zenunit.com/
Frederick C. (Guest)
on 2009-05-25 13:17
(Received via mailing list)
On May 25, 7:44 am, Virendra N. <removed_email_address@domain.invalid>
wrote:
> Hello
> I am trying to use complex-form in my application for which i have to
> use field_for i want to know exactly the main difference of form_for and
> field_for

they are both to do with binding an object to an instance of form
builder, but form_for also outputs the <form> tags. If you thing of
form_for being

"<form #{various form level options}" + fields_for(...) + </form> then
you're not far off.

Fred
This topic is locked and can not be replied to.