From ca7a5bca126f568784238cc80361688c4b453e4b Mon Sep 17 00:00:00 2001 From: "BOYA,CHIU" Date: Thu, 15 Jul 2021 16:59:00 +0800 Subject: [PATCH] move routes from kernel to module --- config/routes.rb | 7 ++++++- lib/registered_sites/engine.rb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 8bb031c..eea601b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,10 @@ Rails.application.routes.draw do - + post "/register/site" => "admin/register_api#register" + post "/register/store_token" => "admin/register_api#send_store_token" + get "/register/confirm_email" => "admin/register_api#confirm_email" + get "/site/permissions" => "admin/register_api#check_permissions" + get "/site/send_email" => "admin/register_api#send_email" + locales = Site.first.in_use_locales rescue I18n.available_locales scope "(:locale)", locale: Regexp.new(locales.join("|")) do diff --git a/lib/registered_sites/engine.rb b/lib/registered_sites/engine.rb index 6c74881..b4f85b9 100644 --- a/lib/registered_sites/engine.rb +++ b/lib/registered_sites/engine.rb @@ -9,7 +9,7 @@ module RegisteredSites authorizable taggable "RegisteredSite" categorizable - set_keyword_contstraints ['/git-auth'] + set_keyword_contstraints ['/git-auth','/register/','/site/permissions','/site/send_email'] side_bar do head_label_i18n 'registered_sites.registered_sites', icon_class: "icons-earth" available_for "users"