Class: Locomotive::ContentAssetsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::ContentAssetsController
- Defined in:
- app/controllers/locomotive/content_assets_controller.rb
Instance Method Summary collapse
Instance Method Details
#bulk_create ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/locomotive/content_assets_controller.rb', line 24 def bulk_create Locomotive::ContentAsset, :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 Locomotive::ContentAsset @content_asset = service.create(content_asset_params) respond_with @content_asset, location: content_assets_path end |
#destroy ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/locomotive/content_assets_controller.rb', line 37 def destroy @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
30 31 32 33 34 35 |
# File 'app/controllers/locomotive/content_assets_controller.rb', line 30 def edit @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 Locomotive::ContentAsset respond_with(@content_assets) do |format| format.html { render_index } end end |