about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-03-22 19:26:22 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-03-22 19:55:14 +0100
commitd6ed2eb512f09600d7cd8150bb9b547442a9d68b (patch)
treef7f2fd55bf288b5380732b03460750e2ba519ec1 /config
parent33fac87e81918e69c781ce07ca339f23a7ac593f (diff)
Prettier account and stream entry URLs
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/config/routes.rb b/config/routes.rb
index b3f623c04..cf8364968 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -24,6 +24,8 @@ Rails.application.routes.draw do
     confirmations:      'auth/confirmations',
   }
 
+  get '/users/:username', to: redirect('/@%{username}'), constraints: { format: :html }
+
   resources :accounts, path: 'users', only: [:show], param: :username do
     resources :stream_entries, path: 'updates', only: [:show] do
       member do
@@ -43,6 +45,9 @@ Rails.application.routes.draw do
     end
   end
 
+  get '/@:username', to: 'accounts#show', as: :short_account
+  get '/@:account_username/:id', to: 'statuses#show', as: :short_account_status
+
   namespace :settings do
     resource :profile, only: [:show, :update]
     resource :preferences, only: [:show, :update]
@@ -189,8 +194,5 @@ Rails.application.routes.draw do
 
   root 'home#index'
 
-  get '/:username', to: redirect('/users/%{username}')
-  get '/:username/:id', to: redirect('/users/%{username}/updates/%{id}')
-
   match '*unmatched_route', via: :all, to: 'application#raise_not_found'
 end