Class: DouguiUsers::UsersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- DouguiUsers::UsersController
- Defined in:
- app/controllers/dougui_users/users_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /users POST /users.xml.
-
#destroy ⇒ Object
DELETE /users/1 DELETE /users/1.xml.
-
#edit ⇒ Object
GET /users/1/edit.
-
#new ⇒ Object
GET /users/new GET /users/new.xml.
-
#update ⇒ Object
PUT /users/1 PUT /users/1.xml.
Methods inherited from ApplicationController
#load_user_using_perishable_token
Instance Method Details
#create ⇒ Object
POST /users POST /users.xml
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/dougui_users/users_controller.rb', line 19 def create @user = User.new(params[:user]) if @user.save DouguiUsers::UserMailer.activation(@user).deliver redirect_to(login_path, :notice => t("successfully_created", :scope => 'users.controller')) else render :action => "new" end end |
#destroy ⇒ Object
DELETE /users/1 DELETE /users/1.xml
44 45 46 47 48 |
# File 'app/controllers/dougui_users/users_controller.rb', line 44 def destroy @user = User.find(params[:id]) @user.destroy redirect_to(root_path, :notice => t("successfully_destroyed", :scope => 'users.controller')) end |
#edit ⇒ Object
GET /users/1/edit
13 14 15 |
# File 'app/controllers/dougui_users/users_controller.rb', line 13 def edit @user = User.find(params[:id]) end |
#new ⇒ Object
GET /users/new GET /users/new.xml
8 9 10 |
# File 'app/controllers/dougui_users/users_controller.rb', line 8 def new @user = User.new end |
#update ⇒ Object
PUT /users/1 PUT /users/1.xml
31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/dougui_users/users_controller.rb', line 31 def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) redirect_to(root_path, :notice => t("successfully_updated", :scope => 'users.controller')) else render :action => "edit" end end |