skip/disable force_ssl for particular controller in rails

后端 未结 3 1376
夕颜
夕颜 2020-12-17 16:53

I need to force SSL on all routes in my application except for message#new controller.

In config/environments/production.rb, I have:

<
3条回答
  •  抹茶落季
    2020-12-17 17:05

    skip_before_action :verify_authenticity_token
    force_ssl except: [:index,:create]
    

    Its worked for me.

提交回复
热议问题