Code improve
This commit is contained in:
parent
6781c1b4ba
commit
dd1ad6bf3e
2 changed files with 19 additions and 18 deletions
|
@ -1,6 +1,6 @@
|
||||||
- page_title "By #{@user.name}", "Snippets"
|
- page_title "By #{@user.name}", "Snippets"
|
||||||
|
|
||||||
%ol.breadcrumb
|
%ol.breadcrumb
|
||||||
%li
|
%li
|
||||||
= link_to snippets_path do
|
= link_to snippets_path do
|
||||||
Snippets
|
Snippets
|
||||||
|
@ -10,4 +10,4 @@
|
||||||
= link_to user_path(@user) do
|
= link_to user_path(@user) do
|
||||||
#{@user.name} profile page
|
#{@user.name} profile page
|
||||||
|
|
||||||
= render 'snippets'
|
= render 'snippets'
|
||||||
|
|
|
@ -344,15 +344,16 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
scope(path: 'u/:username',
|
scope(path: 'u/:username',
|
||||||
|
as: :user,
|
||||||
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ },
|
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ },
|
||||||
controller: :users) do
|
controller: :users) do
|
||||||
get :calendar, action: :calendar, as: :user_calendar
|
get :calendar
|
||||||
get :calendar_activities, action: :calendar_activities, as: :user_calendar_activities
|
get :calendar_activities
|
||||||
get :groups, action: :groups, as: :user_groups
|
get :groups
|
||||||
get :projects, action: :projects, as: :user_projects
|
get :projects
|
||||||
get :contributed, action: :contributed, as: :user_contributed_projects
|
get :contributed, as: :contributed_projects
|
||||||
get :snippets, action: :snippets, as: :user_snippets
|
get :snippets
|
||||||
get '/', action: :show, as: :user
|
get '/', action: :show
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue