1

I would like to use a different template for login & logout for devise. Only problem is that the signup & edit account are in the same controller , registrations_controller:

class Users::RegistrationsController < Devise::RegistrationsController
  include ApplicationHelper
  def create
    super
  end

  def new
    super
  end

  def edit
    super
  end
end

So I can't just add my layout: layout "signup_layout" to the controller because that would make also change the edit account template.

Is there a way to have two seperate controllers or decide the template a page uses in another file?

Thank you for your help.

Pabi
  • 946
  • 3
  • 16
  • 47

1 Answers1

0

"login & logout" and "signup" are actually in different controllers in devise. RegistrationController and SessionController.

Additionally you can also change the view of everything, without changing the devise controller, by generating the views and changing them (see this).

If you want to change what page is displayed after signin or sign out just have a look into the howto page of the devise wiki. There are numerous articles on this (eg. this one).

In general I recommend you to not change the controller until you really have to (in my experience), because you can do a lot of things wrong there, since it is authentication you are dealing with.

smallbutton
  • 3,377
  • 15
  • 27