Rails Generate Devise::session controller

Hi Folks,

Am new to rails.

I user devise in my project ,i need to write some conditions in my session controller.How can i generate devise session controller.

Devise::SessionsController

Please advice…

Hi Folks,

Am new to rails.

I used devise in my project ,i need to write some conditions in my session controller.How can i generate devise session controller.

Devise::SessionsController

Please advice…

  1. Create your custom controller, for example a Admins::SessionsController:
class Users::SessionsController < Devise::SessionsController
end
  1. Tell the router to use this controller:
devise_for :users, :controllers => { :sessions => "users/sessions" }
  1. we changed the controller, it won’t use the “devise/sessions” views, so remember to copy “devise/sessions” to “user/sessions”.

Any queries follow the topic

Configuring controllers

in the page

https://github.com/plataformatec/devise

Hi,

I created session::controller as u said and also used routes like devise_for :users, :controllers => { :sessions => “users/sessions” }

But i got an error

Routing Error

uninitialized constant Users

Try running rake routes for more information on available routes.

Please advice…

Because you don't have a User model.

I have user.rb model.

Your error saying that you don't have Users model and controler may be you created the devise as Admin. If so please replace user with admin in all places.

If u want to understand flow take new project and try documentation (GitHub - heartcombo/devise: Flexible authentication solution for Rails with Warden. ) from top to bottom, then u will understand flow after that you can implement in your project .