Rails--ActionController::Invalid Authenticity Token 솔 루 션

1922 단어 controller
Rails--ActionController::Invalid Authenticity Token 솔 루 션
링크
해결 방법 1:
class FooController < ApplicationController

    protect_from_forgery :except => :index



    # you can disable csrf protection on controller-by-controller basis:

    skip_before_filter :verify_authenticity_token

  end

해결 방법 2:
config/environment/development.rb(또는 production.rb)수정
 # Disable request forgery protection in development environment

   config.action_controller.allow_forgery_protection = false

해결 방법 3:
jquery 나 form 에 가입
<%= tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token) %> 

좋은 웹페이지 즐겨찾기