fernandokosh / redmine_time_tracker

A time tracker plugin for Redmine
Other
203 stars 141 forks source link

Use preceding slash to anchor controller name in all code generating links to TimeTracker controller #67

Closed DimaD closed 12 years ago

DimaD commented 12 years ago

I copy description from the commit because I think it describes the problem well:

If somebody uses namespaced controllers in their code rails will to generate namespaced links. Let's say you have controller with full name CompanyName::OfficesController and have views rendered in it. All URLs generated for this plugin, for example from this code:

{ :controller => 'issues', :action => 'show', :id => time_tracker.issue_id }

will have prefix _/companyname/, in this case:

/company_name/issues/4242

which is wrong. To preven it you need to prefix all controller names with slashes or use named routes.

You can read more about namespaces and routing here:

http://guides.rubyonrails.org/v2.3.11/routing.html#controller-namespaces-and-routing
delaitre commented 12 years ago

Thank you for this patch with a very descriptive commit message :)