Hi! When i am submitting a form, i cannot use params. It is not a hash but HashWithIndifferentAccess. Wots this? Regards, Swanand --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On 12/5/06, swanand deodhar <swanand.blms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi! > When i am submitting a form, i cannot use params. It is not a hash but > HashWithIndifferentAccess. Wots this? > Regards, > Swanand > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
swanand deodhar wrote:> Hi! > When i am submitting a form, i cannot use params. It is not a hash but > HashWithIndifferentAccess. Wots this? > Regards, > SwanandHi 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. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On 12/5/06, Jason Roelofs <jameskilton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 > > On 12/5/06, swanand deodhar <swanand.blms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi! > > When i am submitting a form, i cannot use params. It is not a hash but > > HashWithIndifferentAccess. Wots this? > > Regards, > > Swanand > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, 2006/12/5, swanand deodhar <swanand.blms@gmail.com>:> 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/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thnx for the lead. On 12/5/06, Alan Francis <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > 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. > > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/6/06, swanand deodhar <swanand.blms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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: <input type="text" name="my_field" /> params[:my_field] <input type="text" name="my_model[my_field]" /> params[:my_model][:my_field] Cheers, Max --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---