“csrf token warning fix”

rails, Uncategorized

csrf token warning fix

Solution:
1/ add this to your layout

<%= javascript_tag “var AUTH_TOKEN = #{form_authenticity_token.inspect};” if protect_against_forgery? %>
    <%= csrf_meta_tags %>

Add this to your controller
skip_before_filter :verify_authenticity_token

2/ comment out  protect_from_forgery from your application controller .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s