Class: Admin::AccountsController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::AccountsController
- Defined in:
- app/controllers/admin/accounts_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /account/1 DELETE /account/1.xml.
-
#edit ⇒ Object
GET /account/1/edit.
-
#index ⇒ Object
GET /account GET /account.xml.
-
#show ⇒ Object
GET /account/1 GET /account/1.xml.
-
#update ⇒ Object
PUT /account/1 PUT /account/1.xml.
Instance Method Details
#destroy ⇒ Object
DELETE /account/1 DELETE /account/1.xml
41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/admin/accounts_controller.rb', line 41 def destroy @user = current_user @user.destroy respond_to do |format| format.html { redirect_to([forgeos_core, :admin, :login]) } format.xml { head :ok } end end |
#edit ⇒ Object
GET /account/1/edit
20 21 22 |
# File 'app/controllers/admin/accounts_controller.rb', line 20 def edit @user = current_user end |
#index ⇒ Object
GET /account GET /account.xml
5 6 7 |
# File 'app/controllers/admin/accounts_controller.rb', line 5 def index redirect_to([forgeos_core, :admin, :account]) end |
#show ⇒ Object
GET /account/1 GET /account/1.xml
11 12 13 14 15 16 17 |
# File 'app/controllers/admin/accounts_controller.rb', line 11 def show @user = current_user # respond_to do |format| # format.html # show.html.erb # format.xml { render :xml => @user } # end end |
#update ⇒ Object
PUT /account/1 PUT /account/1.xml
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/admin/accounts_controller.rb', line 26 def update @user = current_user respond_to do |format| if @user.update_attributes(params[:administrator]) flash[:notice] = t('my_account.update.success').capitalize format.xml { head :ok } else format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end format.html { render :action => 'edit' } end end |