Fix return_to on generic "Create" button.
authorTom Clegg <tom@curoverse.com>
Fri, 27 Dec 2013 19:17:52 +0000 (11:17 -0800)
committerTom Clegg <tom@curoverse.com>
Fri, 27 Dec 2013 19:17:52 +0000 (11:17 -0800)
(was "return_to=./", causing a redirect to "http://host:port./")

apps/workbench/app/views/application/_index.html.erb

index 0f6f5517744e8dfa86ba358eae68a6336c33917f..d12c401bc07539b18f206449f6ff8b9abd1a8d3c 100644 (file)
@@ -62,5 +62,5 @@
 <% end %>
 
 <% if controller.model_class.creatable? %>
-<%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", { action: 'create', return_to: './' }, { class: 'btn btn-primary' } %>
+<%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", { action: 'create', return_to: request.url }, { class: 'btn btn-primary' } %>
 <% end %>