Class: Kuhsaft::Cms::AssetsController

Inherits:
AdminController show all
Defined in:
app/controllers/kuhsaft/cms/assets_controller.rb

Instance Method Summary collapse

Methods inherited from AdminController

#set_content_locale

Instance Method Details

#createObject



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

#destroyObject



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

#editObject



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

#indexObject



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

#newObject



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

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

#updateObject



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