From 0b74ae849d3f87564e789673ecf67aa54ec7cd8a Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Mon, 23 Jan 2017 18:28:40 -0600 Subject: Created the gear settings entry and created a way to initialize both sections with one controller Changed views to partials, created the repository view, created a repository_helper to further aid the creation of variables across different controllers --- app/controllers/projects/protected_branches_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/controllers/projects/protected_branches_controller.rb') diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index 2f422d352ed..18d25f91c96 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -8,14 +8,13 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController layout "project_settings" def index - @protected_branch = @project.protected_branches.new - load_gon_index + redirect_to namespace_project_settings_repository_path(@project.namespace, @project) end def create @protected_branch = ::ProtectedBranches::CreateService.new(@project, current_user, protected_branch_params).execute if @protected_branch.persisted? - redirect_to namespace_project_protected_branches_path(@project.namespace, @project) + redirect_to namespace_project_settings_repository_path(@project.namespace, @project) else load_protected_branches load_gon_index @@ -45,7 +44,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController @protected_branch.destroy respond_to do |format| - format.html { redirect_to namespace_project_protected_branches_path } + format.html { redirect_to namespace_project_settings_repository_path } format.js { head :ok } end end -- cgit v1.2.3