Using Rails 2.3.8.
I have this in my shop controller.
def destroy
@shop = Shop.find(params[:id])
@shop.destroy
flash[:notice] = 'Successfully deleted ' + @shop.shop_type.singularize + '.'
redirect_to shops_path(@shop.shop_type)
end
Whenever I delete the shop, I want it to be redirected to the proper shop_type. It redirects me to:
http://localhost:3000/shops.places
instead of the correct URL:
http://localhost:3000/shops?type=places
What can I do to redirect to the proper URL?
Thanks.
Try the following. I’ve changed the redirect_to line