Class: Locomotive::ContentAssetsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::ContentAssetsController
show all
- Defined in:
- app/controllers/locomotive/content_assets_controller.rb
Instance Method Summary
collapse
#require_ssl
#current_site_public_url, #public_page_url, #switch_to_site_url
#sections
#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
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
|
#destroy ⇒ Object
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
|
#index ⇒ Object
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
|