Zhao Yi wrote:
> Max Williams wrote:
>> You can't pass ruby objects from the form to the controller because the 
>> browser has no concept of ruby or rails or any of that stuff.  However, 
>> you can build a hash to put into params like this
>> 
>> <%= hidden_field_tag "foo[bar]", "hello" %>
>> 
>> which creates this situation
>> 
>> params => {:foo => {:bar => "hello"}}
>> 
>> Knowing this, you can make a hidden field tag, or set of hidden field 
>> tags, which recreates the hash you want to pass through.  Ultimately, 
>> this is all that a form does:  it builds a data structure inside params, 
>> which is a hash that can contain other hashes, strings, and arrays.
> 
> But when I get the hash object from params, I get a String object 
> instead of a hash object.

Post up the form and the contents of your params hash please - you can 
see this in your log file.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to