Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

only find parent on non persistance methods

  • Loading branch information...
commit c51ca9a820d05a7a85f920d14d248e31433035ac 1 parent 38e9cd6
Brent Kirby brentkirby authored

Showing 1 changed file with 13 additions and 1 deletion. Show diff stats Hide diff stats

  1. +13 1 app/controllers/transit/assets_controller.rb
14 app/controllers/transit/assets_controller.rb
... ... @@ -1,5 +1,5 @@
1 1 class Transit::AssetsController < AdminController
2   - before_filter :find_deliverable
  2 + before_filter :find_deliverable, only: [:new, :create, :index]
3 3 respond_to :js, :json, :html
4 4 helper_method :parent, :resource
5 5 layout false
@@ -13,7 +13,19 @@ def new
13 13 respond_with(@asset)
14 14 end
15 15
  16 + def create
  17 + @asset = parent.assets.create(params[:asset])
  18 + respond_with(@asset)
  19 + end
  20 +
  21 + def update
  22 + @asset = Asset.find(params[:id])
  23 + @asset.update_attributes(params[:asset])
  24 + respond_with(@asset)
  25 + end
  26 +
16 27 def destroy
  28 + @asset = Asset.find(params[:id])
17 29 resource.destroy
18 30 respond_with(resource)
19 31 end

0 comments on commit c51ca9a

Please sign in to comment.
Something went wrong with that request. Please try again.