Class: Transit::AssetsController
Instance Method Summary
collapse
#edit_mode_enabled?, #render
Instance Method Details
#create ⇒ Object
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
|
#destroy ⇒ Object
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
|
#show ⇒ Object
17
18
19
|
# File 'app/controllers/transit/assets_controller.rb', line 17
def show
@asset = Transit::Asset.find(params[:id])
end
|
#update ⇒ Object
21
22
23
|
# File 'app/controllers/transit/assets_controller.rb', line 21
def update
end
|