Rails.application.routes.draw do locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales scope "(:locale)", locale: Regexp.new(locales.join("|")) do namespace :admin do resources :personal_plugin_fields do get 'fields_setting' , to: 'personal_plugin_fields#fields_setting' post 'update_fields_setting' , to: 'personal_plugin_fields#update_fields_setting' patch 'update_fields_setting' , to: 'personal_plugin_fields#update_fields_setting' get 'generate_plugin' , to: 'personal_plugin_fields#generate_plugin' get 'copy' , to: 'personal_plugin_fields#copy' end resource :personal_plugin_field do post 'check_plugin_exist' ,to: 'personal_plugin_fields#check_plugin_exist' post 'check_modal_name' ,to: 'personal_plugin_fields#check_modal_name' end end end end