summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-14 21:51:32 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-14 21:51:32 +0000
commit8712a0f13e0522dd804c86d9743479d6ee65c235 (patch)
treea6f11c70274bb68ad28ce72b58162ff04a036582 /app
parent209babeedb3c6a9837d79c90db7f7ade2f184cce (diff)
downloadredmine-8712a0f13e0522dd804c86d9743479d6ee65c235.tar.gz
redmine-8712a0f13e0522dd804c86d9743479d6ee65c235.zip
Use named routes.
git-svn-id: http://svn.redmine.org/redmine/trunk@13598 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb29
1 files changed, 10 insertions, 19 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 65cf3ad3e..8bc672e62 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -793,21 +793,18 @@ module ApplicationHelper
if oid.to_s == identifier &&
issue = Issue.visible.find_by_id(oid)
anchor = comment_id ? "note-#{comment_id}" : nil
- link = link_to(h("##{oid}#{comment_suffix}"),
- {:only_path => only_path, :controller => 'issues',
- :action => 'show', :id => oid, :anchor => anchor},
+ link = link_to("##{oid}#{comment_suffix}",
+ issue_path(issue, :only_path => only_path, :anchor => anchor),
:class => issue.css_classes,
:title => "#{issue.subject.truncate(100)} (#{issue.status.name})")
end
when 'document'
if document = Document.visible.find_by_id(oid)
- link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
- :class => 'document'
+ link = link_to(document.title, document_path(document, :only_path => only_path), :class => 'document')
end
when 'version'
if version = Version.visible.find_by_id(oid)
- link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
- :class => 'version'
+ link = link_to(version.name, version_path(version, :only_path => only_path), :class => 'version')
end
when 'message'
if message = Message.visible.find_by_id(oid)
@@ -815,13 +812,11 @@ module ApplicationHelper
end
when 'forum'
if board = Board.visible.find_by_id(oid)
- link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
- :class => 'board'
+ link = link_to(board.name, project_board_path(board.project, board, :only_path => only_path), :class => 'board')
end
when 'news'
if news = News.visible.find_by_id(oid)
- link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
- :class => 'news'
+ link = link_to(news.title, news_path(news, :only_path => only_path), :class => 'news')
end
when 'project'
if p = Project.visible.find_by_id(oid)
@@ -835,23 +830,19 @@ module ApplicationHelper
case prefix
when 'document'
if project && document = project.documents.visible.find_by_title(name)
- link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
- :class => 'document'
+ link = link_to(document.title, document_path(document, :only_path => only_path), :class => 'document')
end
when 'version'
if project && version = project.versions.visible.find_by_name(name)
- link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
- :class => 'version'
+ link = link_to(version.name, version_path(version, :only_path => only_path), :class => 'version')
end
when 'forum'
if project && board = project.boards.visible.find_by_name(name)
- link = link_to h(board.name), {:only_path => only_path, :controller => 'boards', :action => 'show', :id => board, :project_id => board.project},
- :class => 'board'
+ link = link_to(board.name, project_board_path(board.project, board, :only_path => only_path), :class => 'board')
end
when 'news'
if project && news = project.news.visible.find_by_title(name)
- link = link_to h(news.title), {:only_path => only_path, :controller => 'news', :action => 'show', :id => news},
- :class => 'news'
+ link = link_to(news.title, news_path(news, :only_path => only_path), :class => 'news')
end
when 'commit', 'source', 'export'
if project