Bug #2335
closed
submitting a puppet class edit should go back to the class' page
Added by David Schmitt over 11 years ago.
Updated over 11 years ago.
Description
When editing a puppet class, submitting the changes goes back to the list of all classes. This looses the user's context. It would be nice to return to the class itself or the actual page the edit was coming from.
- Assignee deleted (
Ohad Levy)
- Target version set to 1.2.0
- Difficulty set to trivial
I can manage a simple redirect back to /puppetclasses/:id/edit easily enough, but that still loses the context of which class/smart variable you were editing. Perhaps Amos or Jospeh can show me a better way than this:
--- a/app/controllers/puppetclasses_controller.rb
+++ b/app/controllers/puppetclasses_controller.rb
@@ -44,10 +44,12 @@ class PuppetclassesController < ApplicationController
def update
if @puppetclass.update_attributes(params[:puppetclass])
notice _("Successfully updated puppetclass.")
- redirect_to puppetclasses_url
- else
- render :action => 'edit'
end
render :action => 'edit'
end
- Assignee set to Joseph Magen
Since there is no show action for puppetclass, I assume you want a redirect to the referrer page.
- Status changed from New to Ready For Testing
We're a bit confused on the PR as to which page it should redirect back to. Would it be the page that originally led you to the class edit page, e.g. the puppet classes list with your search terms and so on, or back to the class edit page itself, as if Submit was just an "Apply" button?
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to Bug #5773: editing resources in UI returns view to wrong page and search added
Also available in: Atom
PDF