Class: Admin::AccountsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/admin/accounts_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject

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

#editObject

GET /account/1/edit



20
21
22
# File 'app/controllers/admin/accounts_controller.rb', line 20

def edit
  @user = current_user
end

#indexObject

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

#showObject

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

#updateObject

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