nccu-news/config/routes.rb

24 lines
634 B
Ruby
Raw Normal View History

2014-11-07 08:44:11 +00:00
Rails.application.routes.draw do
locales = Site.first.in_use_locales rescue I18n.available_locales
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
namespace :admin do
post 'news/preview', to: 'news#preview'
get 'news/destroy_preview/:slug_title-:uid', to: 'news#destroy_preview'
get 'news/approve_bulletin', to: 'news#approve_bulletin'
get 'news_admins/get_departments' => "news_admins#get_departments"
resources :news
resources :news_admins
end
resources :news do
collection do
get ':slug_title-:uid', to: 'news#show', as: :display
end
end
end
end