Form_tag parameters in nested hash

You can use fields_for inside a form_tag for a more formal way of expressing a namespace.

fields_for :form_fields do |ff|
  ff.text_field :my_text_field
  ff.select :my_select_tag
end

Alternatively just namespace all your form inputs, as such:

text_field_tag "form_fields[my_text_field]"
select_tag "form_fields[my_select_tag]" ...

etc. Then you will get params[:form_fields] = {:my_text_field => "foo", :my_select_tag => "bar"}, which I think is what you wanted.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)