Rails.application.routes.draw do locales = Site.first.in_use_locales rescue I18n.available_locales scope "(:locale)", locale: Regexp.new(locales.join("|")) do post "/xhr/ticket/create", to: 'admin/tickets_api#create' post "/xhr/ticket/close", to: 'admin/tickets_api#close' post "/xhr/ticket/reopen", to: 'admin/tickets_api#reopen' get "/xhr/tickets/:ticket_id", to: 'admin/tickets_api#getticket' get "/xhr/tickets", to: 'admin/tickets_api#gettickets' get "/xhr/ticket/types", to: 'admin/tickets_api#tickettypes' delete "/xhr/ticket/:ticket_id", to: 'admin/tickets_api#destroy' namespace :admin do scope "tickets_manage", :controller => 'tickets_manage',as: 'tickets' do get "search" post "submit_response" delete "delete_response" get "category/:category_id" => 'tickets_manage#tickets_by_category' get "my_tickets" get "tagged_tickets" end post "comments/read" => 'tickets_manage#mark_response_read' resources :tickets_manage do get "start" get "leave" get "changecategory" get "close" post "toggleurgent" post "reopen" end end end end