Class: Admin::ApplicationAccountsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::ApplicationAccountsController
- Defined in:
- app/controllers/admin/application_accounts_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /admin/application_accounts —————————————————————————-.
-
#destroy ⇒ Object
DELETE /admin/application_accounts/1 —————————————————————————-.
-
#index ⇒ Object
GET /admin/application_accounts —————————————————————————-.
-
#update ⇒ Object
PUT /admin/application_accounts/1 —————————————————————————-.
Instance Method Details
#create ⇒ Object
POST /admin/application_accounts
16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/admin/application_accounts_controller.rb', line 16 def create @application_account = ApplicationAccount.new(params["application_account"]) respond_to do |format| if @application_account.save flash[:notice] = 'New application account created' else flash[:notice] = 'There was error creating the application account.' end format.html { redirect_to :action => :index } # go back to index.haml end end |
#destroy ⇒ Object
DELETE /admin/application_accounts/1
45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/admin/application_accounts_controller.rb', line 45 def destroy @application_account = ApplicationAccount.find(params["id"]) respond_to do |format| if @application_account.destroy flash[:notice] = 'Application account deleted' else flash[:notice] = 'There was error deleting the application account.' end format.html { redirect_to :action => :index } # go back to index.haml end end |
#index ⇒ Object
GET /admin/application_accounts
7 8 9 10 11 12 |
# File 'app/controllers/admin/application_accounts_controller.rb', line 7 def index @application_accounts = ApplicationAccount.order(:created_at) respond_to do |format| format.html # index.html.haml end end |
#update ⇒ Object
PUT /admin/application_accounts/1
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/admin/application_accounts_controller.rb', line 30 def update @application_account = ApplicationAccount.find(params["id"]) @application_account.attributes = params["application_account"] respond_to do |format| if @application_account.save flash[:notice] = 'New application account created' else flash[:notice] = 'Please fill out the name and token' end format.html { redirect_to :action => :index } # go back to index.haml end end |