different layout for sign_in action in devise

后端 未结 8 2174
情深已故
情深已故 2020-12-02 05:12

I\'m trying to use a different/custom layout named \"devise\" for the sign_in action. I found this page in the devise wiki, and the second example even says you can do it pe

8条回答
  •  暖寄归人
    2020-12-02 05:41

    I figured it out, but I'll keep this question here in case other people are curious.

    It was a stupid mistake. The fact is sign_in is the path, not the action. Looking at the relevant source, I can see that the required action is new, i.e., creating a new Devise Session. Changing my above code's conditional to:

    if devise_controller? && resource_name == :user && action_name == 'new'
    

    Works beautifully.

    Hope that helps someone out there.

提交回复
热议问题