newtorails.
2007-Jan-25 18:51 UTC
newbie alert! Need help in extracting parameters from the post request
Could somebody please help me with the following? I have following browser dump from the post request which errors in my controller Parameters: {"commit"=>"Find", "item"=>{"id"=>"1"}} I want to extract parameter item[id] from this request. I have tried params[:item].id, params[:id] and params[:item[id]]. None of the above seems to help. thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brad Ediger
2007-Jan-25 18:53 UTC
Re: newbie alert! Need help in extracting parameters from the post request
params[:item][:id] params[:item] returns a hash, which you then index by :id. On Jan 25, 2007, at 12:51 PM, newtorails. wrote:> > Could somebody please help me with the following? > I have following browser dump from the post request which errors in my > controller > Parameters: {"commit"=>"Find", "item"=>{"id"=>"1"}} > > I want to extract parameter item[id] from this request. I have tried > params[:item].id, params[:id] and params[:item[id]]. > > None of the above seems to help. > > thanks > > > --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~--- >
Jodi Showers
2007-Jan-25 18:54 UTC
Re: newbie alert! Need help in extracting parameters from the post request
params[:item][:id] one more try and you likely would have got it Jodi On 25-Jan-07, at 1:51 PM, newtorails. wrote:> > Could somebody please help me with the following? > I have following browser dump from the post request which errors in my > controller > Parameters: {"commit"=>"Find", "item"=>{"id"=>"1"}} > > I want to extract parameter item[id] from this request. I have tried > params[:item].id, params[:id] and params[:item[id]]. > > None of the above seems to help. > > thanks > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
newtorails.
2007-Jan-25 18:57 UTC
Re: newbie alert! Need help in extracting parameters from the post request
thanks jodi and brad. Really appreciate your responses. On Jan 25, 10:54 am, Jodi Showers <j...-BOB1p6JRLoAV+D8aMU/kSg@public.gmane.org> wrote:> params[:item][:id] > > one more try and you likely would have got it > > Jodi > > On 25-Jan-07, at 1:51 PM, newtorails. wrote: > > > > > > > Could somebody please help me with the following? > > I have following browser dump from the post request which errors in my > > controller > > Parameters: {"commit"=>"Find", "item"=>{"id"=>"1"}} > > > I want to extract parameter item[id] from this request. I have tried > > params[:item].id, params[:id] and params[:item[id]]. > > > None of the above seems to help. > > > thanks- Hide quoted text -- Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---