添加:skip_before_action :verify_authenticity_token参考:ruby on rails - Invalid Authenticity Token on Post - Stack Overflow