From fe13f110412d85c05dc68e5ee1db499f681bf722 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 29 Jun 2017 12:06:35 -0500 Subject: Create and use project path helpers that only need a project, no namespace --- app/controllers/projects/branches_controller.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'app/controllers/projects/branches_controller.rb') diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 94a752c21eb..86058531179 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -52,7 +52,7 @@ class Projects::BranchesController < Projects::ApplicationController redirect_to url_to_autodeploy_setup(project, branch_name), notice: view_context.autodeploy_flash_notice(branch_name) else - redirect_to namespace_project_tree_path(@project.namespace, @project, branch_name) + redirect_to project_tree_path(@project, branch_name) end else @error = result[:message] @@ -62,7 +62,7 @@ class Projects::BranchesController < Projects::ApplicationController format.json do if result[:status] == :success - render json: { name: branch_name, url: namespace_project_tree_url(@project.namespace, @project, branch_name) } + render json: { name: branch_name, url: project_tree_url(@project, branch_name) } else render json: result[:messsage], status: :unprocessable_entity end @@ -79,7 +79,7 @@ class Projects::BranchesController < Projects::ApplicationController flash_type = result[:status] == :error ? :alert : :notice flash[flash_type] = result[:message] - redirect_to namespace_project_branches_path(@project.namespace, @project), status: 303 + redirect_to project_branches_path(@project), status: 303 end format.js { render nothing: true, status: result[:return_code] } @@ -90,7 +90,7 @@ class Projects::BranchesController < Projects::ApplicationController def destroy_all_merged DeleteMergedBranchesService.new(@project, current_user).async_execute - redirect_to namespace_project_branches_path(@project.namespace, @project), + redirect_to project_branches_path(@project), notice: 'Merged branches are being deleted. This can take some time depending on the number of branches. Please refresh the page to see changes.' end @@ -106,8 +106,7 @@ class Projects::BranchesController < Projects::ApplicationController end def url_to_autodeploy_setup(project, branch_name) - namespace_project_new_blob_path( - project.namespace, + project_new_blob_path( project, branch_name, file_name: '.gitlab-ci.yml', -- cgit v1.2.1