Class: Auth::Admin::UsersController
- Inherits:
-
BaseController
- Object
- BaseController
- Auth::Admin::UsersController
- Defined in:
- app/controllers/auth/admin/users_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/controllers/auth/admin/users_controller.rb', line 12 def create @user = User.new(user_params) if @user.join(params) redirect_to admin_users_url, notice: 'User was successfully created.' else render :new end end |
#destroy ⇒ Object
40 41 42 43 |
# File 'app/controllers/auth/admin/users_controller.rb', line 40 def destroy @user.destroy redirect_to admin_users_url, alert: 'User was successfully destroyed.' end |
#edit ⇒ Object
24 25 26 |
# File 'app/controllers/auth/admin/users_controller.rb', line 24 def edit end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/auth/admin/users_controller.rb', line 4 def index @users = User.includes(:oauth_users).order(created_at: :desc).default_where(search_params).page(params[:page]) end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/auth/admin/users_controller.rb', line 8 def new @user = User.new end |
#show ⇒ Object
21 22 |
# File 'app/controllers/auth/admin/users_controller.rb', line 21 def show end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/auth/admin/users_controller.rb', line 28 def update respond_to do |format| if @user.update(user_params) format.js { head :no_content } format.html { redirect_to admin_users_url, notice: 'User was successfully updated.' } else format.js { head :no_content } format.html { render :edit } end end end |