Class: Locomotive::ContentAssetsController

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

Instance Method Summary collapse

Methods included from ActionController::Ssl

#require_ssl

Methods included from ActionController::UrlHelpers

#current_site_public_url, #public_page_url, #switch_to_site_url

Methods included from ActionController::SectionHelpers

#sections

Methods included from 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



15
16
17
18
# File 'app/controllers/locomotive/content_assets_controller.rb', line 15

def create
  @content_asset = current_site.content_assets.create(params[:content_asset])
  respond_with @content_asset
end

#destroyObject



20
21
22
23
24
# File 'app/controllers/locomotive/content_assets_controller.rb', line 20

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

#indexObject



6
7
8
9
10
11
12
13
# File 'app/controllers/locomotive/content_assets_controller.rb', line 6

def index
  @content_assets = current_site.content_assets
    .ordered
    .by_content_types(params[:types])
    .by_filename(params[:query])
    .page(params[:page] || 1).per(params[:per_page] || Locomotive.config.ui[:per_page])
  respond_with(@content_assets)
end