I want to configure graphic controllers, is it possible and how to do this?

Is there a way to configure development controllers, since we can modify development types using the rails g devise: views. Generator command?
Here you need to create a statistics line for the current user as soon as the user logs in.
I have user statistics supported for each user. I just want to run the create method of the userstats controller in the background when a user logs in for my web application.

Is there any way to do this?

+4
source share
3 answers

You need to create your own controllers that inherit from Devise's.

class Admins::SessionsController < Devise::SessionsController end 

Then you tell the developer to use this controller:

 devise_for :admins, :controllers => { :sessions => "admins/sessions" } 

And copy your views from applications / sessions to admin / sessions.

You can read it here: https://github.com/plataformatec/devise

+2
source

Or simply do the following:

 rails generate devise:controllers Admin 
+2
source

or copy the development controllers from where they are now in your application. This is what I did with RVM:

 cp -R ~/.rvm/gems/ ruby-1.9.3-p194@my _gemset/gems/devise-2.1.0/app/controllers/* my_rails_app/app/controllers/ 
+1
source

All Articles