On 13 August 2012 20:50, Lille <[email protected]> wrote:
> Hi,
>
> Just like with input tags in a form, where parameter naming can be
> influenced by modifying the tag name attribute...
>
> <input id="person_name" name="person[name]" type="text" value="Henry"/>
>
> ...results in...
>
> {'person' => {'name' => 'Henry'}}
>
> (source: guides.rubyonrails.org/form_helpers.html#basic-structures)
>
> Can I insert attributes into form_tag to customize the parameterization of
> all items inside? For example,
>
> {'whatever_i_want_to_use_as_a_key' => {'person' => {'name' => 'Henry'}}}

Yes it should work.  Did you try it?

I would say though that you should use form_for rather than form_tag
if possible.  So if the form is displaying data for an object then use
form_for.

If you are a beginner then, if you have not already done so, I suggest
you work right through some tutorials such as railstutorial.org (which
is free to use online), that will give you a good basic knowledge of
rails.  Make sure you use a tutorial for rails 3 and install the
correct version of Rails.

Colin

-- 
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 https://groups.google.com/groups/opt_out.


Reply via email to