diff options
author | Long Nguyen <long.polyglot@gmail.com> | 2016-05-10 09:56:12 +0700 |
---|---|---|
committer | Long Nguyen <long.polyglot@gmail.com> | 2016-05-10 09:56:12 +0700 |
commit | dd1ad6bf3e5a378eb8698e95b73e58f935eb0956 (patch) | |
tree | c3b8ffc747eb9a24d97721331ede86ff8ce1e7b3 | |
parent | 6781c1b4ba8bb1a7da0a4bf637d7a311abf281f0 (diff) | |
download | gitlab-ce-dd1ad6bf3e5a378eb8698e95b73e58f935eb0956.tar.gz |
Code improve
-rw-r--r-- | app/views/snippets/index.html.haml | 22 | ||||
-rw-r--r-- | config/routes.rb | 15 |
2 files changed, 19 insertions, 18 deletions
diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index 8aa3d490fa3..7e4918a6085 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,13 +1,13 @@ - - page_title "By #{@user.name}", "Snippets" +- page_title "By #{@user.name}", "Snippets" - %ol.breadcrumb - %li - = link_to snippets_path do - Snippets - %li - = @user.name - .pull-right.hidden-xs - = link_to user_path(@user) do - #{@user.name} profile page +%ol.breadcrumb + %li + = link_to snippets_path do + Snippets + %li + = @user.name + .pull-right.hidden-xs + = link_to user_path(@user) do + #{@user.name} profile page - = render 'snippets' += render 'snippets' diff --git a/config/routes.rb b/config/routes.rb index 594bab204fd..881de37f10e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -344,15 +344,16 @@ Rails.application.routes.draw do end scope(path: 'u/:username', + as: :user, constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, controller: :users) do - get :calendar, action: :calendar, as: :user_calendar - get :calendar_activities, action: :calendar_activities, as: :user_calendar_activities - get :groups, action: :groups, as: :user_groups - get :projects, action: :projects, as: :user_projects - get :contributed, action: :contributed, as: :user_contributed_projects - get :snippets, action: :snippets, as: :user_snippets - get '/', action: :show, as: :user + get :calendar + get :calendar_activities + get :groups + get :projects + get :contributed, as: :contributed_projects + get :snippets + get '/', action: :show end # |