Class: Admin::SetupController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::SetupController
- Defined in:
- app/controllers/admin/setup_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/admin/setup_controller.rb', line 14 def create @spud_user = SpudUser.new(user_params) @spud_user.super_admin = true if @spud_user.save SpudUserSession.create(@spud_user) redirect_to admin_root_path else render 'new', status: 422 end end |
#new ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/controllers/admin/setup_controller.rb', line 5 def new if SpudUser.count.nonzero? flash[:error] = 'Access Denied! This wizard may only be executed when the database is empty.' redirect_to admin_login_path and return else @spud_user = SpudUser.new end end |