Commit 128012db authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

More use of shortcut routes

parent 0a4dec24
......@@ -60,8 +60,7 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format|
format.html do
if @issue.valid?
redirect_to namespace_project_issue_path(@project.namespace,
@project, @issue)
redirect_to issue_path(@issue)
else
render :new
end
......@@ -79,7 +78,7 @@ class Projects::IssuesController < Projects::ApplicationController
format.js
format.html do
if @issue.valid?
redirect_to [@project.namespace.becomes(Namespace), @project, @issue]
redirect_to issue_path(@issue)
else
render :edit
end
......@@ -129,8 +128,7 @@ class Projects::IssuesController < Projects::ApplicationController
issue = @project.issues.find_by(id: params[:id])
if issue
redirect_to namespace_project_issue_path(@project.namespace, @project,
issue)
redirect_to issue_path(issue)
return
else
raise ActiveRecord::RecordNotFound.new
......
......@@ -79,9 +79,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if @merge_request.valid?
redirect_to(
namespace_project_merge_request_path(@merge_request.target_project.namespace,
@merge_request.target_project,
@merge_request),
merge_request_path(@merge_request)
notice: 'Merge request was successfully created.'
)
else
......
%li{ class: mr_css_classes(merge_request) }
.merge-request-title
%span.str-truncated
= link_to_gfm merge_request.title, namespace_project_merge_request_path(merge_request.target_project.namespace, merge_request.target_project, merge_request), class: "row_title"
= link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title"
.pull-right.light
- if merge_request.merged?
%span
......
......@@ -8,5 +8,5 @@
Changes view for this comparison is extremely large.
%p
You can
= link_to "download it", namespace_project_merge_request_path(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request, format: :diff), class: "vlink"
= link_to "download it", merge_request_path(@merge_request, format: :diff), class: "vlink"
instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment