2010-03-29 22:01:47 +00:00
|
|
|
Locomotive::Application.routes.draw do |map|
|
2010-04-11 23:59:18 +00:00
|
|
|
|
|
|
|
constraints(Locomotive::Routing::DefaultConstraint) do
|
|
|
|
root :to => 'home#show'
|
2010-04-13 14:26:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# admin authentication
|
2010-04-22 23:52:11 +00:00
|
|
|
Devise.register(:accounts, :controllers => { :sessions => 'admin/sessions', :passwords => 'admin/passwords' }) # bypass the devise_for :accounts
|
2010-04-13 14:26:40 +00:00
|
|
|
scope '/admin' do
|
2010-04-22 23:52:11 +00:00
|
|
|
get 'login' => 'admin/sessions#new', :as => :new_account_session
|
|
|
|
post 'login' => 'admin/sessions#create', :as => :account_session
|
|
|
|
get 'logout' => 'admin/sessions#destroy', :as => :destroy_account_session
|
|
|
|
resource :password, :only => [:new, :create, :edit, :update], :controller => 'admin/passwords'
|
2010-04-13 14:26:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# admin interface for each website
|
|
|
|
namespace 'admin' do
|
2010-04-24 00:32:36 +00:00
|
|
|
root :to => 'pages#index'
|
|
|
|
|
|
|
|
resources :pages
|
|
|
|
|
2010-04-22 23:52:11 +00:00
|
|
|
# get 'login' => 'sessions#new', :as => :new_account_session
|
|
|
|
# post 'login' => 'sessions#create', :as => :account_session
|
|
|
|
# get 'logout' => 'sessions#destroy', :as => :destroy_account_session
|
|
|
|
# resource :password, :only => [:new, :create, :edit, :update], :controller => 'devise/passwords'
|
2010-04-11 23:59:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
match '/' => 'pages#show'
|
2010-03-29 22:01:47 +00:00
|
|
|
end
|