ruby on rails - ActiveAdmin and Devise - skip_confirmation! on create action -


i want call user.skip_confirmation while account created admin in admin panel. want user confirm account in further steps of registration process, not on create. idea have override create in controller:

controller   def create     user = user.new     user.skip_confirmation!     user.confirmed_at = nil     user.save!   end end 

the problem is, have different attr_accessibles standard user , admin, , works, because activeadmin uses inheritedresources:

attr_accessible :name, :surname attr_accessible :name, :surname, invitation_token, :as => :admin 

it doesn't work after changed create (it worked before). how can want , still able use :as => :admin feature?

i @ answer , none solving issue @ hand. solve simplest way shown below.

before_create |user|  user.skip_confirmation! end 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -