ruby - How make rails forms submit if using rails-api gem. Undefined method `protect_against_forgery? -


i have rails application api using gem rails-api. trying create admin panel on because realised later need admin panel. think rails-api doesnt have support views.

when try submit forms says undefined method protect_against_forgery? maybe because doesnt supports <%= csrf_meta_tags %>

i tried define manually method in controller no luck.

def protect_against_forgery?   true end 

how can submit forms without getting error.

in api controller put following line.

skip_before_filter :verify_authenticity_token 

or try

def protect_against_forgery?   false end 

this may you.


Comments