Class: Smithy::UsersController
- Inherits:
-
BaseController
- Object
- BaseController
- Smithy::UsersController
- Defined in:
- app/controllers/smithy/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/smithy/users_controller.rb', line 16 def create @user = User.new(filtered_params) @user.save flash.notice = "The user was created" if @user.persisted? respond_with @user do |format| format.html { redirect_to [:edit, @user] } end end |
#destroy ⇒ Object
38 39 40 41 42 |
# File 'app/controllers/smithy/users_controller.rb', line 38 def destroy @user = User.find(params[:id]) @user.destroy respond_with @user end |
#edit ⇒ Object
25 26 27 28 |
# File 'app/controllers/smithy/users_controller.rb', line 25 def edit @user = User.find(params[:id]) respond_with @user end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/smithy/users_controller.rb', line 7 def index respond_with @users end |
#new ⇒ Object
11 12 13 14 |
# File 'app/controllers/smithy/users_controller.rb', line 11 def new @user = User.new(filtered_params) respond_with @user end |
#update ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/controllers/smithy/users_controller.rb', line 30 def update @user = User.find(params[:id]) flash.notice = "The user was saved" if @user.update_attributes(filtered_params) respond_with @user do |format| format.html { redirect_to [:edit, @user] } end end |