0
votes

My custom Devise Sessions controller isn't letting me sign in. I've had several difficulties trying to customize the Devise controllers, but I can't figure out what's going on here.

When I try to sign in, the page (sessions#new) simply re-renders. How can I get my custom controller back to full functionality?

# controllers/sessions_controller

class SessionsController < Devise::SessionsController
  skip_before_filter :store_last_attempted_location
  skip_after_filter  :store_last_successful_location

  def new
    super
  end

  def create
    super
  end

  def destroy
    super
  end
end

My routes

#config/routes.rb

devise_for :users, :controllers => { :sessions => "sessions", :registrations => "registrations"  }

Thanks in advance.

1
I guess the sign in credentials are invalid which is causing the re-rendering. Can you verify that they are correct? Make sure that you are displaying flash messages in application.html.erb because if credentials are invalid then devise sets the error message in flash. - Kirti Thorat♦
Correct on both counts, sir, thank you. Not sure how I got deleted, but there it is. - steel

1 Answers

1
votes

If the sign in page is re-rendered after entering the user credentials then it means that the credentials are invalid which is resulting in the re-rendering. But that should have resulted in a flash message on the re-rendered page as Devise uses flash messages to let the application users know if sign in was successful or failure.

Make sure that you are displaying flash messages in application.html.erb as:

<% flash.each do |name, msg| %>
  <%= content_tag :div, msg %>
<% end %>