ruby - Rails nested resource with respond_with destroy action -


what appropriate respond_with line nested resources destroy action?

my routes:

resources :vendors   resources :products, :except => [:index] end 

product#destroy (note @vendor , @product found before_filter omitted here)

def destroy   @product.destroy    respond_with @vendor, @product end 

according functional tests, returning /vendors/x/products/x , not /vendors/x

should change responed_to @vendor?

i believe rails smart enough understand if @product destroyed

respond_with [@vendor, @product] 

if not, try this

respond_with @product, :location => vendor_path(@vendor) 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -