submitting a puppet class edit should go back to the class' page
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.
#2 Updated by Greg Sutcliffe about 6 years ago
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
#6 Updated by Dominic Cleal almost 6 years ago
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?