2014-11-06 14:46:59 +01:00
|
|
|
Rails.application.routes.draw do
|
2015-03-20 04:54:44 +01:00
|
|
|
devise_for :users, controllers: {
|
2015-08-31 14:33:15 +02:00
|
|
|
omniauth_callbacks: "callbacks",
|
|
|
|
sessions: "sessions"
|
2015-03-20 04:54:44 +01:00
|
|
|
}
|
2014-12-09 17:17:11 +01:00
|
|
|
|
2015-01-06 20:18:01 +01:00
|
|
|
devise_scope :user do
|
|
|
|
unauthenticated :user do
|
2015-03-25 17:49:37 +01:00
|
|
|
root to: 'welcome#index'
|
2015-01-09 12:31:14 +01:00
|
|
|
end
|
2015-03-03 20:11:50 +01:00
|
|
|
|
|
|
|
authenticated :user, ->(u) { u.koelkast? } do
|
|
|
|
root to: 'orders#overview', as: :koelkast_root
|
|
|
|
end
|
|
|
|
|
|
|
|
authenticated :user, ->(u) { !u.koelkast? } do
|
|
|
|
root to: 'users#show', as: :user_root
|
2015-01-06 20:18:01 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-12-09 22:32:54 +01:00
|
|
|
resources :users do
|
2015-02-04 19:03:50 +01:00
|
|
|
resources :orders
|
2015-09-07 21:15:16 +02:00
|
|
|
member do
|
|
|
|
get 'quickpay' => 'orders#quickpay'
|
|
|
|
get 'dagschotel/edit' => 'users#edit_dagschotel', as: 'edit_dagschotel'
|
|
|
|
get 'dagschotel/:product_id' => 'users#update_dagschotel', as: 'dagschotel'
|
|
|
|
end
|
2014-11-25 15:27:12 +01:00
|
|
|
end
|
2014-11-06 18:30:53 +01:00
|
|
|
|
2015-09-01 23:13:20 +02:00
|
|
|
resources :products
|
|
|
|
resources :stocks
|
2015-02-09 17:06:24 +01:00
|
|
|
|
2015-01-06 20:33:11 +01:00
|
|
|
get 'overview' => 'orders#overview', as: "orders"
|
2014-11-06 14:46:59 +01:00
|
|
|
end
|