diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-01-24 03:28:40 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-03-06 18:47:43 +0300 |
commit | 0b74ae849d3f87564e789673ecf67aa54ec7cd8a (patch) | |
tree | 2bf4220555d8953d16cbc378923f4edf8617bdb3 /app/controllers/projects/protected_branches_controller.rb | |
parent | c51d72036698c6d53602c58f09d5ddd3ed8d225b (diff) |
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
Diffstat (limited to 'app/controllers/projects/protected_branches_controller.rb')
-rw-r--r-- | app/controllers/projects/protected_branches_controller.rb | 7 |
1 files changed, 3 insertions, 4 deletions
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 |