summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDavid Piegza <david.piegza@mailbox.org>2017-02-20 18:01:37 +0100
committerDavid Piegza <david.piegza@mailbox.org>2017-02-21 15:15:01 +0100
commit3f7b7a3b0f2199c56b9f5acab07539610ae10c7c (patch)
tree5cf4829900eaf8eea466787cee58fe88160f893a /app/helpers
parent2338ac73ad1aec7a2daf76bc1486e1da70fc879e (diff)
downloadgitlab-ce-3f7b7a3b0f2199c56b9f5acab07539610ae10c7c.tar.gz
Fix preselected namespace when creating a project
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/namespaces_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index 0676767d910..dc5ae8edbb2 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -1,4 +1,8 @@
module NamespacesHelper
+ def namespace_id_from(params)
+ params.dig(:project, :namespace_id) || params[:namespace_id]
+ end
+
def namespaces_options(selected = :current_user, display_path: false, extra_group: nil)
groups = current_user.owned_groups + current_user.masters_groups