Class: Kuhsaft::Cms::AssetsController
Instance Method Summary
collapse
#set_content_locale, #url_options
Instance Method Details
#create ⇒ Object
14
15
16
17
18
|
# File 'app/controllers/kuhsaft/cms/assets_controller.rb', line 14
def create
@asset = Kuhsaft::Asset.create params[:kuhsaft_asset]
@asset.save
respond_with @asset, location: cms_assets_path
end
|
#destroy ⇒ Object
31
32
33
34
35
|
# File 'app/controllers/kuhsaft/cms/assets_controller.rb', line 31
def destroy
@asset = Kuhsaft::Asset.find(params[:id])
@asset.destroy
redirect_to cms_assets_path
end
|
#edit ⇒ Object
20
21
22
23
|
# File 'app/controllers/kuhsaft/cms/assets_controller.rb', line 20
def edit
@asset = Kuhsaft::Asset.find(params[:id])
respond_with @asset
end
|
#index ⇒ Object
4
5
6
7
|
# File 'app/controllers/kuhsaft/cms/assets_controller.rb', line 4
def index
@assets = Kuhsaft::Asset.by_date
respond_with @assets
end
|
#new ⇒ Object
9
10
11
12
|
# File 'app/controllers/kuhsaft/cms/assets_controller.rb', line 9
def new
@asset = Kuhsaft::Asset.new
respond_with @asset
end
|
#update ⇒ Object
25
26
27
28
29
|
# File 'app/controllers/kuhsaft/cms/assets_controller.rb', line 25
def update
@asset = Kuhsaft::Asset.find(params[:id])
@asset.update_attributes(params[:kuhsaft_asset])
respond_with @asset, location: cms_assets_path
end
|