Sha256: 4bbcbd68d0584664b6c92acff7632d3959b4c781e87993f177616e9464ff847b

Contents?: true

Size: 971 Bytes

Versions: 4

Compression:

Stored size: 971 Bytes

Contents

module Kuhsaft
  module Admin
    class AssetsController < ApplicationController
      respond_to :html
      layout 'kuhsaft/admin'
      
      def index
        @assets = Kuhsaft::Asset.by_date
        respond_with @assets
      end
    
      def new
        @asset = Kuhsaft::Asset.new
        respond_with @asset
      end
    
      def create
        @asset = Kuhsaft::Asset.create params[:kuhsaft_asset]
        @asset.save
        respond_with @asset, :location => admin_assets_path
      end
    
      def edit
        @asset = Kuhsaft::Asset.find(params[:id])
        respond_with @asset
      end
    
      def update
        @asset = Kuhsaft::Asset.find(params[:id])
        @asset.update_attributes(params[:kuhsaft_asset])
        respond_with @asset, :location => admin_assets_path
      end
    
      def destroy
        @asset = Kuhsaft::Asset.find(params[:id])
        @asset.destroy
        redirect_to admin_assets_path
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kuhsaft-0.0.6 app/controllers/kuhsaft/admin/assets_controller.rb
kuhsaft-0.0.5 app/controllers/kuhsaft/admin/assets_controller.rb
kuhsaft-0.0.4 app/controllers/kuhsaft/admin/assets_controller.rb
kuhsaft-0.0.3 app/controllers/kuhsaft/admin/assets_controller.rb