In Rails 4 beta1, I'm getting a "HTTP/1.1 422 Unprocessable Entity" error when attempting a post request to an API. The controller is raising an ActionController::InvalidAuthenticityToken error.
Do I need to somehow disable request forgery protection for APIs?
I still maintain that you should be able to delete records in Rails by default when Javascript is not available, I've been banging on about this since 2006:
I must get around to implementing it as an Engine. I find it frustrating that you have to include the whole of jQuery on an app that doesn't otherwise require Javascript, just to let users delete records.
Ryan, even though there haven't been any Railscasts for a while, I keep referring back to these and they've saved me so many times. Thanks!
Hope all is going well on your hiatus.
Found the answer in the Edge Docs here: http://edgeapi.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html#method-i-protect_against_forgery-3F
...others might benefit if this is included in the show notes.
In Rails 4 beta1, I'm getting a "HTTP/1.1 422 Unprocessable Entity" error when attempting a post request to an API. The controller is raising an ActionController::InvalidAuthenticityToken error.
Do I need to somehow disable request forgery protection for APIs?
This could work nicely with Mongoid to create custom fields in MongoDB.
I still maintain that you should be able to delete records in Rails by default when Javascript is not available, I've been banging on about this since 2006:
I must get around to implementing it as an Engine. I find it frustrating that you have to include the whole of jQuery on an app that doesn't otherwise require Javascript, just to let users delete records.
p.s. loving the Pro and Revised episodes Ryan!