Class: Transit::AssetsController

Inherits:
TransitController show all
Defined in:
app/controllers/transit/assets_controller.rb

Instance Method Summary collapse

Methods inherited from TransitController

#edit_mode_enabled?, #render

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
# File 'app/controllers/transit/assets_controller.rb', line 8

def create
  @asset  = Transit::Asset.new(params[:asset])
  @parent = params[:resource_type].constantize.find(params[:resource_id])
  @asset.assetable = @parent
  @asset.save
  flash[:success] = "Upload successful!"
  respond_with(@asset)    
end

#destroyObject



25
26
27
28
29
# File 'app/controllers/transit/assets_controller.rb', line 25

def destroy
  @asset = Transit::Asset.find(params[:id])
  @asset.destroy
  respond_with(@asset)
end

#showObject



17
18
19
# File 'app/controllers/transit/assets_controller.rb', line 17

def show
  @asset = Transit::Asset.find(params[:id])
end

#updateObject



21
22
23
# File 'app/controllers/transit/assets_controller.rb', line 21

def update
  
end