2014-11-06 14:46:59 +01:00
|
|
|
Rails.application.routes.draw do
|
2014-12-09 17:17:11 +01:00
|
|
|
devise_for :users
|
|
|
|
|
2015-01-06 20:18:01 +01:00
|
|
|
devise_scope :user do
|
|
|
|
unauthenticated :user do
|
2015-01-09 12:31:14 +01:00
|
|
|
root to: 'devise/sessions#new'
|
|
|
|
end
|
|
|
|
authenticated :user do
|
|
|
|
root to: 'devise/sessions#new', constraints: lambda { |req| req.env['warden'].user.nil? }, as: 'unauth_root'
|
|
|
|
root to: 'orders#overview', constraints: lambda { |req| req.env['warden'].user.koelkast? }, as: 'koelkast_root'
|
|
|
|
root to: 'users#show', constraints: lambda { |req| !req.env['warden'].user.koelkast? }, as: 'user_root'
|
2015-01-06 20:18:01 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-12-09 22:32:54 +01:00
|
|
|
resources :users do
|
2014-12-17 07:31:51 +01:00
|
|
|
resources :orders, only: [:new, :create, :index]
|
2014-12-10 13:21:06 +01:00
|
|
|
get 'quickpay' => 'orders#quickpay'
|
2014-12-10 14:18:56 +01:00
|
|
|
get 'dagschotel/:product_id' => 'users#dagschotel', as: "dagschotel"
|
2014-11-25 15:27:12 +01:00
|
|
|
end
|
2014-11-06 18:30:53 +01:00
|
|
|
|
2014-11-25 15:27:12 +01:00
|
|
|
resources :products
|
2014-12-10 16:17:55 +01:00
|
|
|
get 'admins' => 'admins#schulden', as: "admins_schulden"
|
2015-01-06 20:33:11 +01:00
|
|
|
get 'overview' => 'orders#overview', as: "orders"
|
2014-11-06 14:46:59 +01:00
|
|
|
end
|