video_pro/config/routes.rb

23 lines
772 B
Ruby

Rails.application.routes.draw do
if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console')
video_pro_setting = VideoProSetting.first
if video_pro_setting.nil?
video_pro_setting = VideoProSetting.create
end
end
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
post "/video_pro/save_image_order", to: "video_pros#save_image_order"
resources :video_pros do
collection do
get 'settings'
post 'update_settings'
patch 'update_settings'
end
end
end
end
get '/xhr/video_pro/show_api/:title-:uid', to: 'video_pros#show_api'
end