I''m trying to figure out when and where the method override is parsed and dealt with. This works curl ''http://www.whatsayye.com/questions/3.json'' \ -X "POST" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "X-HTTP-Method-Override: PUT" \ -d "{ \"question\": { \"question\": \"Is Override the Answer?\", \"url\": \"put_override\" }}" This doesn''t curl ''http://www.whatsayye.com/questions/3.json'' \ -X "GET" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "X-HTTP-Method-Override: PUT" \ -d "{ \"question\": { \"question\": \"Is Override the Answer?\", \"url\": \"put_override\" }}" Any hints for me? I''m using rails 2.3.3 AJ ONeal -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I lied, the first one just doesn''t return an error, but it doesn''t work either. AJ ONeal On Sat, Nov 28, 2009 at 11:45 AM, AJ ONeal <Alvin.ONeal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m trying to figure out when and where the method override is parsed and > dealt with. > > This works > > curl ''http://www.whatsayye.com/questions/3.json'' \ > -X "POST" \ > -H "Content-Type: application/json" \ > -H "Accept: application/json" \ > -H "X-HTTP-Method-Override: PUT" \ > -d "{ \"question\": { \"question\": \"Is Override the Answer?\", > \"url\": \"put_override\" }}" > > This doesn''t > > curl ''http://www.whatsayye.com/questions/3.json'' \ > -X "GET" \ > -H "Content-Type: application/json" \ > -H "Accept: application/json" \ > -H "X-HTTP-Method-Override: PUT" \ > -d "{ \"question\": { \"question\": \"Is Override the Answer?\", > \"url\": \"put_override\" }}" > > Any hints for me? > > I''m using rails 2.3.3 > > AJ ONeal >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I lied about lying; I was actually telling the truth. (it was expecting the json I was posting to be translated to an object params[:my_model_name] but actually it was put in params[:_json] [:my_model_name]. But I can''t find where it is that I Rails determines whether to use the overridden method or the original method so that I can tell it to allow JSON as well. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rick DeNatale
2009-Nov-28 22:39 UTC
Re: Re: When and Where does is the Method Override parsed?
On Sat, Nov 28, 2009 at 5:02 PM, CoolAJ86 <coolaj86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I lied about lying; I was actually telling the truth. > (it was expecting the json I was posting to be translated to an object > params[:my_model_name] but actually it was put in params[:_json] > [:my_model_name]. > > But I can''t find where it is that I Rails determines whether to use > the overridden method or the original method so that I can tell it to > allow JSON as well.It''s actually not Rails code which does this anymore but a Rack middleware called Rack::MethodOverride which is part of Rack http://rack.rubyforge.org/doc/classes/Rack/MethodOverride.html -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- Challenge for object_id, Garbage Value
- Possible to ask rspec to show more code in the debugger?
- Anyone using the rspec textmate bundle with Ruby 1.9.1
- Any pioneers who've configured passenger to support some apps running in 1.8.x others in 1.9?
- Class method not being stubbed