Screwy title, but what I am trying to do is... I have an incoming POST to a typical Rails /:controller/:action url. That post has one value, not a name-value pair. So, Rail''s params has that data as a key (along with the other stuff Rails adds to params). Now, in my current fiddling, it can be extracted as params.keys[0] -- but I don''t think I can count on that position as the params hash is, well, a hash. Is there a better way to acquire this data? -- gw -- 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 16 Jan 2008, at 22:20, Greg Willits wrote:> > Screwy title, but what I am trying to do is... > > I have an incoming POST to a typical Rails /:controller/:action url. > > That post has one value, not a name-value pair. So, Rail''s params has > that data as a key (along with the other stuff Rails adds to params). > Now, in my current fiddling, it can be extracted as params.keys[0] -- > but I don''t think I can count on that position as the params hash is, > well, a hash. > > Is there a better way to acquire this data?look at request.raw_post ? Fred> -- gw > -- > 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 16 Jan 2008, at 22:20, Greg Willits wrote: > >> >> Is there a better way to acquire this data? > look at request.raw_post ?Perfect. Thanks, Fred. -- gw -- 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 Jan 16, 2008, at 4:20 PM, Greg Willits wrote:> > Screwy title, but what I am trying to do is... > > I have an incoming POST to a typical Rails /:controller/:action url. > > That post has one value, not a name-value pair. So, Rail''s params has > that data as a key (along with the other stuff Rails adds to params). > Now, in my current fiddling, it can be extracted as params.keys[0] -- > but I don''t think I can count on that position as the params hash is, > well, a hash. > > Is there a better way to acquire this data? >Hi Greg, I did something like this: http://localhost:3000/my_controller/my_action/success and in the controller, params[:id] == ''success'' I''m pretty sure that works because http://localhost:3000/my_controller/my_action/1 the 1 gets mapped to :id automatically. That was my reasoning anyway, and so far it has worked correctly. I don''t know if that will work for you or not. And I''m not using any special/custom routing. Just the plain stuff that Rails 1.2.3 defines. Peace, Phillip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---