Closed ZachOrr closed 11 years ago
The idea behind the params[:referrer]
business though is that if you're using the delete button from the parts list in a sub-assembly page, you'll go back there after it's deleted instead of having to navigate your way back from the project page.
Maybe instead, we check the referrer and clear it out if it's equal to the part's own page, so that the original params[:referrer] || "/projects/#{project_id}"
will fall through to the latter value.
Sounds legit! I should have poked around a little more to see where other people could have come from to delete (I was just on the dashboard)
I'd fix the code and resubmit so you could just merge instead of updating it yourself, but I haven't dived into Ruby yet...
Done in 21216859fb53ac2c57edcacc04d7321d7892092e.
Just a quick fix
When deleting a part, there's an issue with the redirects. It'll redirect you back to the part's page that's now deleted (I'm assuming params[:referrer] refers to the previous part's page). Now it only redirects back to the dashboard page.