Class: Qbrick::Cms::AssetsController

Inherits:
BackendController show all
Defined in:
app/controllers/qbrick/cms/assets_controller.rb

Instance Method Summary collapse

Methods inherited from BackendController

#default_url_options, #reset_remembered_locale, #set_content_locale

Instance Method Details

#createObject



14
15
16
17
18
# File 'app/controllers/qbrick/cms/assets_controller.rb', line 14

def create
  @asset = Qbrick::Asset.create params[:qbrick_asset]
  @asset.save
  respond_with @asset, location: cms_assets_path
end

#destroyObject



31
32
33
34
35
# File 'app/controllers/qbrick/cms/assets_controller.rb', line 31

def destroy
  @asset = Qbrick::Asset.find(params[:id])
  @asset.destroy
  redirect_to cms_assets_path
end

#editObject



20
21
22
23
# File 'app/controllers/qbrick/cms/assets_controller.rb', line 20

def edit
  @asset = Qbrick::Asset.find(params[:id])
  respond_with @asset
end

#indexObject



4
5
6
7
# File 'app/controllers/qbrick/cms/assets_controller.rb', line 4

def index
  @assets = Qbrick::Asset.by_date
  respond_with @assets
end

#newObject



9
10
11
12
# File 'app/controllers/qbrick/cms/assets_controller.rb', line 9

def new
  @asset = Qbrick::Asset.new
  respond_with @asset
end

#updateObject



25
26
27
28
29
# File 'app/controllers/qbrick/cms/assets_controller.rb', line 25

def update
  @asset = Qbrick::Asset.find(params[:id])
  @asset.update_attributes(params[:qbrick_asset])
  respond_with @asset, location: cms_assets_path
end