Class: Locomotive::ContentAssetsController

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

Instance Method Summary collapse

Methods included from Locomotive::Concerns::UrlHelpersController

#current_site_public_url, #public_page_url

Instance Method Details

#bulk_createObject



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

#createObject



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

#destroyObject



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

#editObject



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

#indexObject



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