Simplify routes

sites
aeris 7 months ago
parent 757de1e1e5
commit ae0223186c
  1. 31
      config/routes.rb

@ -1,29 +1,10 @@
Rails.application.routes.draw do
namespace :https, id: /[^\/]+/ do
get ':id/', action: :show
get ':id/refresh', action: :refresh, as: :refresh
end
namespace :smtp, id: /[^\/]+/ do
get ':id/', action: :show
get ':id/refresh', action: :refresh, as: :refresh
end
namespace :xmpp, id: /[^\/]+/ do
get ':id/', action: :show
get ':id/refresh', action: :refresh, as: :refresh
end
namespace :tls, id: /[^\/]+/ do
get '/', action: :index
get ':id/', action: :show
get ':id/refresh', action: :refresh, as: :refresh
end
namespace :ssh, id: /[^\/]+/ do
get '/', action: :index
get ':id/', action: :show
get ':id/refresh', action: :refresh, as: :refresh
%i[https smtp xmpp tls ssh].each do |type|
namespace type, id: /[^\/]+/ do
get '/', action: :index
get ':id/', action: :show
get ':id/refresh', action: :refresh, as: :refresh
end
end
get 'help' => 'site#help'

Loading…
Cancel
Save