Project

General

Profile

Bug #2416

_puppetclasses_or_envs_changed.html.erb does not honor the RAILS_RELATIVE_URL_ROOT

Added by Sébastien Bernard over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Difficulty:
trivial
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

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.

puppetclass_bug.diff puppetclass_bug.diff 800 Bytes Sébastien Bernard, 04/19/2013 09:57 AM

Associated revisions

Revision be8d401b (diff)
Added by Sébastien Bernard over 6 years ago

fixes #2416 - use relative URL prefix for environment import buttons

History

#1 Updated by Dominic Cleal over 6 years ago

  • Status changed from New to Assigned
  • Assignee changed from Ohad Levy to Dominic Cleal
  • Target version set to 1.2.0

#2 Updated by Dominic Cleal over 6 years ago

  • Status changed from Assigned to Ready For Testing

#3 Updated by Sébastien Bernard over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF