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
Post a Comment