Permalink
Browse files

Override some more clearance routes to use proper layout. Sign in pag…

…e is all better now.
  • Loading branch information...
1 parent 190926b commit f1826d35eedf878d5d60dbea14d04e38524820b3 @kasima kasima committed Oct 8, 2010
Showing with 7 additions and 3 deletions.
  1. +1 −1 app/controllers/sessions_controller.rb
  2. +5 −1 config/routes.rb
  3. +1 −1 test/functional/sessions_controller_test.rb
@@ -4,7 +4,7 @@ def create
params[:session][:password])
if @user.nil?
flash_failure_after_create
- render :template => 'sessions/new', :status => :unauthorized
+ render :template => 'sessions/new', :status => :unauthorized, :layout => "sessions"
else
unless @user.active?
flash[:notice] = "User has been deactivated. Please contact administrator."
View
@@ -1,10 +1,14 @@
ActionController::Routing::Routes.draw do |map|
map.resource :session, :controller => 'sessions', :only => [:new, :create, :destroy]
-
+
map.resources :users, :controller => 'users' do |users|
users.resource :password, :controller => 'clearance/passwords', :only => [:create, :edit, :update]
users.resource :confirmation, :controller => 'clearance/confirmations', :only => [:new, :create]
end
+
+ map.sign_in 'sign_in', :controller => 'sessions', :action => 'new'
+ map.sign_out 'sign_out', :controller => 'sessions', :action => 'destroy', :method => :delete
+
Clearance::Routes.draw(map)
map.published_current 'published/:layout_name/:instance_name/:plate_name',
@@ -2,7 +2,7 @@
class SessionsControllerTest < ActionController::TestCase
- should_route :get, "/sessions", :controller => "sessions", :action => "create"
+ should_route :post, "/session", :controller => "sessions", :action => "create"
context 'on POST to #create with inactive user' do
setup do

0 comments on commit f1826d3

Please sign in to comment.