Class: Admin::UsersController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::UsersController
- Defined in:
- app/controllers/admin/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/admin/users_controller.rb', line 16 def create @user = User.new(params[:user]) if @user.respond_to?(:author) @user. ||= current_user end @user.save respond_with(@user) end |
#destroy ⇒ Object
33 34 35 36 |
# File 'app/controllers/admin/users_controller.rb', line 33 def destroy @user.destroy respond_with(@user) end |
#edit ⇒ Object
13 14 |
# File 'app/controllers/admin/users_controller.rb', line 13 def edit end |
#index ⇒ Object
4 5 6 7 |
# File 'app/controllers/admin/users_controller.rb', line 4 def index @search = User.search(params[:search]) @users = @search.page(params[:page] || 1) end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/admin/users_controller.rb', line 9 def new @user = User.new end |
#update ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/admin/users_controller.rb', line 27 def update @user.attributes = params[:user] @user.save respond_with(@user) end |