Class: Locomotive::Api::AccountsController
Instance Method Summary
collapse
#back_to_default_site_locale, #current_content_locale, #localized?, #set_back_office_locale, #set_current_content_locale, #setup_i18n_fallbacks
Instance Method Details
#create ⇒ Object
21
22
23
24
25
26
|
# File 'app/controllers/locomotive/api/accounts_controller.rb', line 21
def create
@account = Locomotive::Account.from_presenter(params[:account])
authorize! :create, @account
@account.save
respond_with(@account)
end
|
#destroy ⇒ Object
28
29
30
31
32
33
|
# File 'app/controllers/locomotive/api/accounts_controller.rb', line 28
def destroy
@account = Locomotive::Account.find(params[:id])
authorize! :destroy, @account
@account.destroy
respond_with(@account)
end
|
#index ⇒ Object
9
10
11
12
13
|
# File 'app/controllers/locomotive/api/accounts_controller.rb', line 9
def index
@accounts = Locomotive::Account.all
authorize! :index, @accounts
respond_with(@accounts)
end
|
#show ⇒ Object
15
16
17
18
19
|
# File 'app/controllers/locomotive/api/accounts_controller.rb', line 15
def show
@account = Locomotive::Account.find(params[:id])
authorize! :show, @account
respond_with(@account)
end
|