Hi!
When i am submitting a form, i cannot use params. It is not a hash but HashWithIndifferentAccess. Wots this?
Regards,
Swanand
Hi!
When i am submitting a form, i cannot use params. It is not a hash but HashWithIndifferentAccess. Wots this?
Regards,
Swanand
HashWithIndifferentAccess is simply a Rails modification to Hash to allow:
hash[‘key’] == hash[:key]
In Ruby’s native Hash, the above would be false.
What is your problem with @params?
Jason
Whne i write params[:some_symbol] after the form submission where some_symbol is some text field in the form, it shows a nil object
Regards,
Swanand
Hi,
Thnx for the lead.
Check the html code for the form field. the :some_symbol part must match the "name" atribute of the form field. Parameters can be nested:
<input type="text" name="my_field" /> params[:my_field]
<input type="text" name="my_model[my_field]" /> params[:my_model][:my_field]
Cheers, Max