Permalink
Browse files

Namespaced the sessions controller

  • Loading branch information...
1 parent 4ecad82 commit 8aa0a8f07c2d0e18b3842afb361daef450cd8d1f @jferris jferris committed Mar 26, 2009
@@ -1,14 +1,18 @@
-class SessionsController < ApplicationController
+class Clearance::SessionsController < ApplicationController
protect_from_forgery :except => :create
filter_parameter_logging :password
+ def new
+ render :template => 'sessions/new'
+ end
+
def create
@user = User.authenticate(params[:session][:email],
params[:session][:password])
if @user.nil?
flash.now[:notice] = "Bad email or password."
- render :action => :new, :status => :unauthorized
+ render :template => 'sessions/new', :status => :unauthorized
else
if @user.email_confirmed?
remember(@user) if remember?
View
@@ -1,6 +1,6 @@
ActionController::Routing::Routes.draw do |map|
map.resources :passwords, :controller => 'clearance/passwords'
- map.resource :session
+ map.resource :session, :controller => 'clearance/sessions'
map.resources :users do |users|
users.resource :password, :controller => 'clearance/passwords'
users.resource :confirmation, :controller => 'clearance/confirmations'
@@ -2,6 +2,8 @@
class SessionsControllerTest < ActionController::TestCase
+ tests Clearance::SessionsController
+
should_filter_params :password
context "on GET to /sessions/new" do

0 comments on commit 8aa0a8f

Please sign in to comment.