This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # While using curl post call then disable request forgery protection | |
| # For get method call, It skips the check | |
| # Reference : http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html | |
| class XyzController < ApplicationController | |
| skip_before_filter :verify_authenticity_token, :only => [:update] | |
| before_filter :authenticate_user!, :only => [:update, :index] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # For Ruby on Rails | |
| # It will give hash of given model object | |
| model_obj.serializable_hash | |
| # Another way to get hash of a model object | |
| ActiveSupport::JSON.decode(model_obj.to_json) | |
| For MultiJson issue use | |
| https://github.com/intridea/multi_json |
NewerOlder