Sha256: 8c4fe3b6401a0eebf0862e4e1650370690ec22404379c616d9a8cd3db7557881

Contents?: true

Size: 906 Bytes

Versions: 4

Compression:

Stored size: 906 Bytes

Contents

module Kuhsaft
  module Admin
    class AssetsController < AdminController
      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.1.1 app/controllers/kuhsaft/admin/assets_controller.rb
kuhsaft-0.1.0 app/controllers/kuhsaft/admin/assets_controller.rb
kuhsaft-0.0.8 app/controllers/kuhsaft/admin/assets_controller.rb
kuhsaft-0.0.7 app/controllers/kuhsaft/admin/assets_controller.rb