Rails: Before process_action callback :authenticate_user! has not been defined

前端 未结 2 1365
说谎
说谎 2021-02-20 00:13

I\'m creating a rails app that includes devise. I\'m trying to add Twilio messaging to my site with Ngrok, i used this tutorial: https://www.twilio.com/blog/2016/04/receive-and-

2条回答
  •  情书的邮戳
    2021-02-20 00:37

    Twilio developer evangelist here.

    It looks like this was a problem that Rails 5 seems to have introduced. If the filter hasn't been defined by the time it is used in a controller it will raise an error. This was discovered in the Clearance project too.

    Their fix was to pass the raise: false option to skip_before_filter:

    class MessagesController < ApplicationController
      skip_before_filter :verify_authenticity_token 
      skip_before_filter :authenticate_user!, :only => "reply", :raise => false
    
    end
    

    Let me know if that helps at all.

提交回复
热议问题