diff options
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/config/routes.rb b/config/routes.rb index abb77094ab9..8c3eef23260 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,8 +10,8 @@ Gitlab::Application.routes.draw do # # Search # - get 'search' => "search#show" - get 'search/autocomplete' => "search#autocomplete", as: :search_autocomplete + get 'search' => 'search#show' + get 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete # API API::API.logger Rails.logger @@ -20,9 +20,9 @@ Gitlab::Application.routes.draw do # Get all keys of user get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ } - constraint = lambda { |request| request.env["warden"].authenticate? and request.env['warden'].user.admin? } + constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? } constraints constraint do - mount Sidekiq::Web, at: "/admin/sidekiq", as: :sidekiq + mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq end # Enable Grack support @@ -46,10 +46,10 @@ Gitlab::Application.routes.draw do # resources :snippets do member do - get "raw" + get 'raw' end end - get "/s/:username" => "snippets#user_index", as: :user_snippets, constraints: { username: /.*/ } + get '/s/:username' => 'snippets#user_index', as: :user_snippets, constraints: { username: /.*/ } # # Github importer area @@ -72,12 +72,12 @@ Gitlab::Application.routes.draw do end resources :groups, only: [:index] - root to: "projects#trending" + root to: 'projects#trending' end # Compatibility with old routing - get 'public' => "explore/projects#index" - get 'public/projects' => "explore/projects#index" + get 'public' => 'explore/projects#index' + get 'public/projects' => 'explore/projects#index' # # Attachments serving @@ -122,7 +122,7 @@ Gitlab::Application.routes.draw do resource :application_settings, only: [:show, :update] - root to: "dashboard#index" + root to: 'dashboard#index' end # @@ -163,7 +163,7 @@ Gitlab::Application.routes.draw do # # Dashboard Area # - resource :dashboard, controller: "dashboard", only: [:show] do + resource :dashboard, controller: 'dashboard', only: [:show] do member do get :projects get :issues @@ -194,12 +194,12 @@ Gitlab::Application.routes.draw do devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions, confirmations: :confirmations } devise_scope :user do - get "/users/auth/:provider/omniauth_error" => "omniauth_callbacks#omniauth_error", as: :omniauth_error + get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error end # # Project Area # - resources :projects, constraints: { id: /[a-zA-Z.0-9_\-]+\/[a-zA-Z.0-9_\-]+/ }, except: [:new, :create, :index], path: "/" do + resources :projects, constraints: { id: /[a-zA-Z.0-9_\-]+\/[a-zA-Z.0-9_\-]+/ }, except: [:new, :create, :index], path: '/' do member do put :transfer post :archive @@ -220,6 +220,7 @@ Gitlab::Application.routes.draw do # Cannot be GET to differentiate from GET paths that end in preview. post :preview, on: :member end + resource :avatar, only: [:show, :destroy] resources :new_tree, only: [:show, :update], constraints: {id: /.+/}, path: 'new' resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/} resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} @@ -237,7 +238,7 @@ Gitlab::Application.routes.draw do resources :snippets, constraints: {id: /\d+/} do member do - get "raw" + get 'raw' end end @@ -249,7 +250,7 @@ Gitlab::Application.routes.draw do end member do - get "history" + get 'history' end end @@ -258,7 +259,7 @@ Gitlab::Application.routes.draw do resource :repository, only: [:show, :create] do member do - get "archive", constraints: { format: Gitlab::Regex.archive_formats_regex } + get 'archive', constraints: { format: Gitlab::Regex.archive_formats_regex } end end @@ -281,13 +282,13 @@ Gitlab::Application.routes.draw do resources :refs, only: [] do collection do - get "switch" + get 'switch' end member do # tree viewer logs - get "logs_tree", constraints: { id: Gitlab::Regex.git_reference_regex } - get "logs_tree/:path" => "refs#logs_tree", + get 'logs_tree', constraints: { id: Gitlab::Regex.git_reference_regex } + get 'logs_tree/:path' => 'refs#logs_tree', as: :logs_file, constraints: { id: Gitlab::Regex.git_reference_regex, @@ -353,10 +354,11 @@ Gitlab::Application.routes.draw do delete :delete_attachment end end + end end - get ':id' => "namespaces#show", constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} + get ':id' => 'namespaces#show', constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} - root to: "dashboard#show" + root to: 'dashboard#show' end |