Metro::Application.routes.draw do
get "comments/index"
root 'main#index'
post "main", to: 'main#index'
post "contacts", to: 'contacts#send_email'
get "contacts", to: 'contacts#index'
get "cabinet", to: 'cabinet#index'
get "cabinet/for_diler", as: 'for_diler'
post "cabinet/for_diler" , to: 'cabinet#send_request', as: 'send_app'
#get "sing_up", to: 'registration#sing_up'
#get "sing_in", to: 'session#new'
get "articles", to: 'articles#index'
get "articles/:url", to: 'articles#show', as: 'article'
get "about", to: 'about#index'
get "rate(/:url)", to: 'rate#index', as: 'rate'
get "company/:url", to: 'company#index', as: 'company'
post "company/:url/message", to: 'company#message', as: 'message_company'
post "company/:url/comment", to: 'company#comment', as: 'comment_company'
post "company/:url/answer", to: 'company#answer', as: 'answer_company'
get "catalog", to: 'catalog#index'
get "catalog/:url", to: 'catalog#show', as: 'category'
get "tag/:id", to: 'tag#index', as: 'tag'
get "search", to: 'search#index', as: 'search'
get "comments/(:id)", to: 'comments#index', as: 'comments'
mount Ckeditor::Engine => '/ckeditor'
#devise_for :admin_users, ActiveAdmin::Devise.config
devise_for :admin_users, path:"user", controllers: {registrations: 'registrations',
sessions: 'session', passwords: 'passwords',
omniauth_callbacks: "omniauth_callbacks"}
devise_scope :admin_user do
get 'user/sign_out', :to => "session#destroy"
end
ActiveAdmin.routes(self)
end