be careful with nested controllers in helpers

pull/77/head
Philipp Tessenow 12 years ago
parent fbfc117a60
commit 8e32cfc6df
  1. 4
      app/helpers/issues_helper.rb
  2. 2
      app/helpers/projects_helper.rb
  3. 4
      app/helpers/queries_helper.rb
  4. 8
      app/helpers/repositories_helper.rb
  5. 2
      app/helpers/users_helper.rb

@ -117,7 +117,7 @@ module IssuesHelper
def query_links(title, queries)
# links to #index on issues/show
url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
url_params = controller_name == 'issues' ? {:controller => '/issues', :action => 'index', :project_id => @project} : params
content_tag('h3', title) +
queries.collect {|query|
@ -261,7 +261,7 @@ module IssuesHelper
def issue_quick_info(issue)
ret = link_to(h("#{issue.tracker.name} ##{issue.id} #{issue.status}: #{issue.subject} "),
{ :controller => 'issues', :action => 'show', :id => issue.id },
{ :controller => '/issues', :action => 'show', :id => issue.id },
:class => issue.css_classes,
:title => "#{ truncate(issue.subject, :length => 100) } (#{ issue.status.name })")
ret += "#{ issue.start_date.nil? ? "[?]" : issue.start_date.to_s }"

@ -16,7 +16,7 @@ module ProjectsHelper
def link_to_version(version, html_options = {}, options={})
return '' unless version && version.is_a?(Version)
options
link_to_if version.visible?, options[:before_text].to_s + format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, html_options
link_to_if version.visible?, options[:before_text].to_s + format_version_name(version), { :controller => '/versions', :action => 'show', :id => version }, html_options
end
def project_settings_tabs

@ -30,7 +30,7 @@ module QueriesHelper
case value.class.name
when 'String'
if column.name == :subject
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
link_to(h(value), :controller => '/issues', :action => 'show', :id => issue)
else
h(value)
end
@ -49,7 +49,7 @@ module QueriesHelper
when 'Project'
link_to_project value
when 'Version'
link_to(h(value), :controller => 'versions', :action => 'show', :id => value)
link_to(h(value), :controller => '/versions', :action => 'show', :id => value)
when 'TrueClass'
l(:general_text_Yes)
when 'FalseClass'

@ -82,7 +82,7 @@ module RepositoriesHelper
if s = tree[file][:s]
style << ' folder'
path_param = to_path_param(@repository.relative_path(file))
text = link_to(h(text), :controller => 'repositories',
text = link_to(h(text), :controller => '/repositories',
:action => 'show',
:id => @project,
:path => path_param,
@ -92,13 +92,13 @@ module RepositoriesHelper
elsif c = tree[file][:c]
style << " change-#{c.action}"
path_param = to_path_param(@repository.relative_path(c.path))
text = link_to(h(text), :controller => 'repositories',
text = link_to(h(text), :controller => '/repositories',
:action => 'entry',
:id => @project,
:path => path_param,
:rev => @changeset.identifier) unless c.action == 'D'
text << raw(" - #{h(c.revision)}") unless c.revision.blank?
text << raw(' (' + link_to(l(:label_diff), :controller => 'repositories',
text << raw(' (' + link_to(l(:label_diff), :controller => '/repositories',
:action => 'diff',
:id => @project,
:path => path_param,
@ -181,7 +181,7 @@ module RepositoriesHelper
:disabled => (repository && !repository.new_record?),
:onchange => remote_function(
:url => {
:controller => 'repositories',
:controller => '/repositories',
:action => 'edit',
:id => @project
},

@ -35,7 +35,7 @@ module UsersHelper
end
def change_status_link(user)
url = {:controller => 'users', :action => 'update', :id => user, :page => params[:page], :status => params[:status], :tab => nil}
url = {:controller => '/users', :action => 'update', :id => user, :page => params[:page], :status => params[:status], :tab => nil}
if user.locked?
link_to l(:button_unlock), url.merge(:user => {:status => User::STATUS_ACTIVE}), :method => :put, :class => 'icon icon-unlock'

Loading…
Cancel
Save