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.
55c581991eb44e46404d6465d975eb6d?d=identicon&s=25 Virendra Negi (virendra)
on 2009-05-25 08: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
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-05-25 09:05
(Received via mailing list)
On 25/05/2009, at 4:44 PM, Virendra Negi 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/
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-05-25 11:17
(Received via mailing list)
On May 25, 7:44 am, Virendra Negi <rails-mailing-l...@andreas-s.net>
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.