Class: InvoiceBar::AccountsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- InvoiceBar::AccountsController
- Defined in:
- app/controllers/invoice_bar/accounts_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /accounts POST /accounts.json.
-
#destroy ⇒ Object
DELETE /accounts/1 DELETE /accounts/1.json.
-
#edit ⇒ Object
GET /accounts/1/edit.
-
#index ⇒ Object
GET /accounts GET /accounts.json.
-
#new ⇒ Object
GET /accounts/new.
-
#show ⇒ Object
GET /accounts/1 GET /accounts/1.json.
-
#update ⇒ Object
PATCH/PUT /accounts/1 PATCH/PUT /accounts/1.json.
Instance Method Details
#create ⇒ Object
POST /accounts POST /accounts.json
33 34 35 36 37 |
# File 'app/controllers/invoice_bar/accounts_controller.rb', line 33 def create @account = InvoiceBar::Account.new(account_params) current_user.accounts << @account respond_on_create @account end |
#destroy ⇒ Object
DELETE /accounts/1 DELETE /accounts/1.json
47 48 49 50 |
# File 'app/controllers/invoice_bar/accounts_controller.rb', line 47 def destroy @account.destroy respond_on_destroy @account, account_url end |
#edit ⇒ Object
GET /accounts/1/edit
27 28 29 |
# File 'app/controllers/invoice_bar/accounts_controller.rb', line 27 def edit respond_on_edit @account end |
#index ⇒ Object
GET /accounts GET /accounts.json
9 10 11 12 |
# File 'app/controllers/invoice_bar/accounts_controller.rb', line 9 def index @accounts = current_user.accounts.page(params[:page]) respond_on_index @accounts end |
#new ⇒ Object
GET /accounts/new
21 22 23 24 |
# File 'app/controllers/invoice_bar/accounts_controller.rb', line 21 def new @account = InvoiceBar::Account.new respond_on_new @account end |
#show ⇒ Object
GET /accounts/1 GET /accounts/1.json
16 17 18 |
# File 'app/controllers/invoice_bar/accounts_controller.rb', line 16 def show respond_on_show @account end |
#update ⇒ Object
PATCH/PUT /accounts/1 PATCH/PUT /accounts/1.json
41 42 43 |
# File 'app/controllers/invoice_bar/accounts_controller.rb', line 41 def update respond_on_update @account, account_params end |