i have a rails app that serves some apis to an iphone application. I want to be able to simply post on a resource without minding on get the correct csrf token. I tried some method that I see here in stackoverflow but it seems they no longer work on rails 3. Thank you for helping me.
相关问题
- Eager-loading association count with Arel (Rails 3
- Multiple Django sites on the same domain - CSRF fa
- CSRF Middleware - change csrf_token output (from x
- Rails simple model attributes not saved to databas
- how to change csrf field id from YII_CSRF_TOKEN to
相关文章
- “No explicit conversion of Symbol into String” for
- Rspec controller error expecting <“index”> but
- Factory_girl has_one relation with validates_prese
- Rails: Twitter Bootstrap Buttons when visited get
- is there a “rails” way to redirect if mobile brows
- Got ActiveRecord::AssociationTypeMismatch on model
- superclass mismatch for class CommentsController (
- rails 3, how add a simple confirmation dialog when
With Rails 4, you now have the option to write in
skip_before_action
instead ofskip_before_filter
.or
In Rails3 you can disable the csrf token in your controller for particular methods:
In the controller where you want to disable CSRF the check:
Or to disable it for everything except a few methods:
Or to disable only specified methods:
More info: RoR Request Forgery Protection