Class: Locomotive::Api::ThemeAssetsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/locomotive/api/theme_assets_controller.rb

Instance Method Summary collapse

Methods included from Locomotive::ActionController::LocaleHelpers

#back_to_default_site_locale, #current_content_locale, #localized?, #set_back_office_locale, #set_current_content_locale, #setup_i18n_fallbacks

Instance Method Details

#createObject



17
18
19
20
21
22
# File 'app/controllers/locomotive/api/theme_assets_controller.rb', line 17

def create
  @theme_asset = current_site.theme_assets.new
  @theme_asset.from_presenter(params[:theme_asset])
  @theme_asset.save
  respond_with @theme_asset, :location => main_app.locomotive_api_theme_assets_url
end

#destroyObject



31
32
33
34
35
# File 'app/controllers/locomotive/api/theme_assets_controller.rb', line 31

def destroy
  @theme_asset = current_site.theme_assets.find(params[:id])
  @theme_asset.destroy
  respond_with @theme_asset
end

#indexObject



7
8
9
10
# File 'app/controllers/locomotive/api/theme_assets_controller.rb', line 7

def index
  @theme_assets = current_site.theme_assets.all
  respond_with(@theme_assets)
end

#showObject



12
13
14
15
# File 'app/controllers/locomotive/api/theme_assets_controller.rb', line 12

def show
  @theme_asset = current_site.theme_assets.find(params[:id])
  respond_with @theme_asset
end

#updateObject



24
25
26
27
28
29
# File 'app/controllers/locomotive/api/theme_assets_controller.rb', line 24

def update
  @theme_asset = current_site.theme_assets.find(params[:id])
  @theme_asset.from_presenter(params[:theme_asset])
  @theme_asset.save
  respond_with @theme_asset, :location => main_app.locomotive_api_theme_assets_url
end