Bug #2416
closed_puppetclasses_or_envs_changed.html.erb does not honor the RAILS_RELATIVE_URL_ROOT
Description
We deployed foreman with a prefix URI /foreman.
The application works ok with the RAILS_RELATIVE_URL_ROOT but for the import from smart-proxy.
The page has a form with 2 buttons that points to an relative url without the "/foreman".
We located the problem in the "app/views/common/_puppetclasses_or_envs_changed.html.erb".
The links are like this:
<%= form_tag "/#{controller_path}/obsolete_and_new" do ->
<= link_to "Cancel","/" + controller_path, :class => "btn" %>
Once changed to :
<%= form_tag eval("obsolete_and_new_#{controller_name}_path") do ->
<= link_to "Cancel", eval("obsolete_and_new_#{controller_name}_path"), :class => "btn" %>
The links works ok with the prefix correctly appended.
I'm not sur about the Cancel link. I've attached a diff file to the bug.
Files