I'm following a Redmine Plugin tutorial and the author uses the following code in a hook, which is called from within a view, which:
def load_issues(count)
(...)
issues = Issue.find(:all, :limit => count, :order => "created_on DESC")
issues.each do |issue|
html = "</p> <li>
#{ link_to h(truncate(issue.subject, :length => 60)), :controller => 'issues', :action => 'show', :id => issue }
</li> <p>"
end
return html
end
The returned HTML is rendered on a page. My Bitnami Redmine installation's root is http://localhost/redmine
The problem is with the URL generated by link_to
:
<a href="/issues/2">feature 1</a>
when I'm expecting something like this:
<a href="/redmine/issues/2">feature 1</a>
Other links generated by core Redmine are aware of the root and work fine, so something is missing from this implementation. I looked at some of the code in core Redmine and the link_to
calls look just like this one though, with nothing extra added.
This was a bug that has now been fixed and will be in 3.0 (unfortunately no backport for 2.6).