Class: Qbrick::Cms::AssetsController
Instance Method Summary
collapse
#default_url_options, #reset_remembered_locale, #set_content_locale
Instance Method Details
#create ⇒ Object
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
|
#destroy ⇒ Object
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
|
#edit ⇒ Object
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
|
#index ⇒ Object
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
|
#new ⇒ Object
9
10
11
12
|
# File 'app/controllers/qbrick/cms/assets_controller.rb', line 9
def new
@asset = Qbrick::Asset.new
respond_with @asset
end
|
#update ⇒ Object
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
|