[Rails] Re: Accessing Raw Post Data

2010-01-18 Thread doug
> Click this link and bookmark the Code Search. That's really handy. Thanks a batch. ... doug -- 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-t...@googlegroups.com. To unsubscrib

[Rails] Re: Accessing Raw Post Data

2010-01-17 Thread Alpha Blue
Doug Jolley wrote: >> irb(main):001:0> "foo".to_sym.class >> => Symbol >> >> irb(main):002:0> :foo.to_s.class >> => String > > VIOLA!!! That seems to be the missing link. Thanks ever so much. :) > > ... doug One thing more to consider doug is learning from what you just discovered. I

[Rails] Re: Accessing Raw Post Data

2010-01-17 Thread Marnen Laibow-Koser
Doug Jolley wrote: >> irb(main):001:0> "foo".to_sym.class >> => Symbol >> >> irb(main):002:0> :foo.to_s.class >> => String > > VIOLA!!! Viola: string instrument that I happen to play. Voilà: French for "there it is". :) > That seems to be the missing link. Thanks ever so much. :) Great. Now

[Rails] Re: Accessing Raw Post Data

2010-01-17 Thread doug
> irb(main):001:0> "foo".to_sym.class > => Symbol > > irb(main):002:0> :foo.to_s.class > => String VIOLA!!! That seems to be the missing link. Thanks ever so much. :) ... doug -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To

[Rails] Re: Accessing Raw Post Data

2010-01-17 Thread Jeff Lewis
$ irb irb(main):001:0> "foo".to_sym.class => Symbol irb(main):002:0> :foo.to_s.class => String Jeff On Jan 17, 4:19 pm, doug wrote: > > I'd avoid using Net::HTTP to do anything > > Thanks for the input.  Your point is well taken. > > None-the-less, I'd still like to be able to do this.  The pr

[Rails] Re: Accessing Raw Post Data

2010-01-17 Thread doug
> I'd avoid using Net::HTTP to do anything Thanks for the input. Your point is well taken. None-the-less, I'd still like to be able to do this. The problem with my code seems to be in this line: ordered_params[key]=params[key] This is an assignment statement to an element of an ordered hash.

[Rails] Re: Accessing Raw Post Data

2010-01-17 Thread Jeff Lewis
I'd avoid using Net::HTTP to do anything but the most simple of httpclient work. You'll save a ton of time/effort by using a more full featured httpclient to perform your POST. There are a lot of ruby httpclient options out there. Which one to use kind of depends on which one you like using that

[Rails] Re: Accessing Raw Post Data

2010-01-16 Thread doug
> To get an array of ordered keys for the POSTed keys/vals, you could do > something like: > >   ... >   if request.post? >     ordered_keys = request.raw_post.split('&').collect {|k_v| > CGI::unescape(k_v.split('=').first.to_s) } >   ... Thanks. That worked great for parsing the raw post data (a

[Rails] Re: Accessing Raw Post Data

2010-01-15 Thread Jeff Lewis
To get an array of ordered keys for the POSTed keys/vals, you could do something like: ... if request.post? ordered_keys = request.raw_post.split('&').collect {|k_v| CGI::unescape(k_v.split('=').first.to_s) } ... and then use those ordered_keys in to access the params vals to accomplish

[Rails] Re: Accessing Raw Post Data

2010-01-15 Thread doug
> Try raw_post > (http://api.rubyonrails.org/classes/ActionController/AbstractRequest.h...) Thanks for the suggestion. What I got to work for me was request.rawpost. That yields a string containing the post data formatted like a get request. I can take it from here. However, my approach would