Class: Monologue::Admin::UsersController
- Inherits:
-
BaseController
- Object
- BaseController
- Monologue::Admin::UsersController
- Defined in:
- app/controllers/monologue/admin/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/monologue/admin/users_controller.rb', line 30 def create @user = Monologue::User.new user_params if @user.save flash.notice = I18n.t("monologue.admin.users.create.success") redirect_to admin_users_path else render :new end end |
#destroy ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/controllers/monologue/admin/users_controller.rb', line 22 def destroy if @user.destroy redirect_to admin_users_path, notice: I18n.t("monologue.admin.users.delete.removed", user: @user.name) else redirect_to admin_users_path, alert: I18n.t("monologue.admin.users.delete.failed", user: @user.name) end end |
#edit ⇒ Object
5 6 7 |
# File 'app/controllers/monologue/admin/users_controller.rb', line 5 def edit end |
#index ⇒ Object
40 41 42 |
# File 'app/controllers/monologue/admin/users_controller.rb', line 40 def index @users = Monologue::User.all end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/monologue/admin/users_controller.rb', line 9 def new @user = Monologue::User.new end |
#update ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/controllers/monologue/admin/users_controller.rb', line 13 def update if @user.update user_params flash.notice = "User modified" redirect_to admin_users_path else render :edit end end |