Trip
Trip

Reputation: 27114

Rails does not recognize Patch request method, but PUT works

I'm probably just not noticing some small simple detail. But if I have an object Backbone model : $.object, and I save it as :

$.object.save({'correct': 1})

This works fine as a PUT request.

However, if I do :

$.object.save({'correct': 1}, {patch: true});

Then it delivers a PATCH request to the same URL, but returns a 404, URL not found..

I can't wrap my head around this..

Upvotes: 0

Views: 422

Answers (1)

janfoeh
janfoeh

Reputation: 10328

  • What does rake routes say? Does it list the PATCH route for your action as expected?
  • What does the log say? Does the action actually receive a PATCH request?

Upvotes: 1

Related Questions