Class: CargoWiki::UsersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- CargoWiki::UsersController
- Defined in:
- app/controllers/cargo_wiki/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
13 14 15 16 17 18 19 20 |
# File 'app/controllers/cargo_wiki/users_controller.rb', line 13 def create @user = User.new(params[:user]) if @user.save redirect_to users_path, :notice => "Account created!" else render "new" end end |
#destroy ⇒ Object
39 40 41 42 43 |
# File 'app/controllers/cargo_wiki/users_controller.rb', line 39 def destroy @user = User.find(params[:id]) @user.destroy redirect_to users_path, :notice => "successfully destroyed!" end |
#edit ⇒ Object
26 27 28 |
# File 'app/controllers/cargo_wiki/users_controller.rb', line 26 def edit @user = User.find(params[:id]) end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/cargo_wiki/users_controller.rb', line 5 def index @users = User.all end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/cargo_wiki/users_controller.rb', line 9 def new @user = User.new end |
#show ⇒ Object
22 23 24 |
# File 'app/controllers/cargo_wiki/users_controller.rb', line 22 def show @user = User.find(params[:id]) end |
#update ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/controllers/cargo_wiki/users_controller.rb', line 30 def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) redirect_to users_path, :notice => "Updated successfully!" else render "edit" end end |