Redirect back to Content page after save/publish


(Kevin Young) #1

I think the UX for this is suboptimal.

I think the default behavior should be that it doesn’t redirect back to the Content page (“admin/nodes” page) but instead just reloads the current page.

Editors usually like to save work as they go along editing a piece of content, and this makes the workflow more difficult.

What do you think?


(Netzc) #2

I use this initializer, which should achieve what you want:

config/initializers/push_type_patch.rb

Rails.configuration.to_prepare do
	module PushType
		NodesController.class_eval do

			private

			def redirect_path(skip_trash = false)
	      if @node.trashed? && !skip_trash
	        push_type.trash_nodes_path
	      else
	        push_type.edit_node_path(@node)
	      end
	    end
		end	
	end
end