Params hash

Hi!
When i am submitting a form, i cannot use params. It is not a hash but
HashWithIndifferentAccess. Wots this?
Regards,
Swanand

swanand deodhar wrote:

Hi!
When i am submitting a form, i cannot use params. It is not a hash but
HashWithIndifferentAccess. Wots this?
Regards,
Swanand

Hi have you tried Google at all ? It often has the answer to many
questions.

http://www.google.com/search?hl=en&q=HashWithIndifferentAccess

“this class has dubious semantics and we only have it so that people can
write params[:key] instead of params[‘key’]”

It allows indexing by symbol or string.

What do you mean “i cannot use params” ?

A.

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

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

Thnx for the lead.

Hi,

2006/12/5, swanand deodhar [email protected]:

Hi!
When i am submitting a form, i cannot use params. It is not a hash but
HashWithIndifferentAccess. Wots this?

I suggest you look at your log/development.log file. You’ll see the
full params hash values in there.

Bye !

François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/

On 12/6/06, swanand deodhar [email protected] wrote:

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

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:

params[:my_field] params[:my_model][:my_field]

Cheers,
Max