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
#current_site_public_url, #public_page_url
Instance Method Details
#bulk_create ⇒ Object
24
25
26
27
|
# File 'app/controllers/locomotive/content_assets_controller.rb', line 24
def bulk_create
@content_assets = service.bulk_create(content_assets_params)
respond_with @content_assets, location: content_assets_path
end
|
#create ⇒ Object
18
19
20
21
22
|
# File 'app/controllers/locomotive/content_assets_controller.rb', line 18
def create
authorize Locomotive::ContentAsset
@content_asset = current_site.content_assets.create(content_asset_params)
respond_with @content_asset, location: content_assets_path
end
|
#destroy ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'app/controllers/locomotive/content_assets_controller.rb', line 36
def destroy
authorize @content_asset
service.destroy(@content_asset)
respond_with(@content_asset) do |format|
format.html do
if request.xhr?
load_content_assets
render_index
else
redirect_to content_assets_path
end
end
end
end
|
#edit ⇒ Object
29
30
31
32
33
34
|
# File 'app/controllers/locomotive/content_assets_controller.rb', line 29
def edit
authorize @content_asset
respond_with(@content_asset) do |format|
format.html { render_edit }
end
end
|
#index ⇒ Object
11
12
13
14
15
16
|
# File 'app/controllers/locomotive/content_assets_controller.rb', line 11
def index
authorize Locomotive::ContentAsset
respond_with(@content_assets) do |format|
format.html { render_index }
end
end
|