views:

140

answers:

3

I have followed the basic instalation ( http://railscasts.com/episodes/67-restful-authentication )

Doing this:

1.) ruby script/generate authenticated user sessions

2.) ruby script/generate authenticated user sessions and rake db:migrate

3.) On the file application_controler.rb I have included

include AuthenticatedSystem

4.) On the file routes.rb I have included

 map.signup  '/signup', :controller => 'users',   :action => 'new'
 map.login  '/login',  :controller => 'session', :action => 'new'
 map.logout '/logout', :controller => 'session', :action => 'destroy'
 map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil

The problem is that on localhost:3000/ appears the same usual " "Welcome aboard You’re riding Ruby on Rails!" page.

How do I put the login page appearing on localhost:3000 ?

A: 

You can add this to your routes.rb:

# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
map.root :controller => 'session', :action => 'new'

There's probably a commented out map.root in your routes.rb file already.

Shadwell
Didnt Work ... What can I do ?
Code Burn
Did it not work as in made no difference whatsoever? Or not work as in returns an error?My 'session' controller is actually 'sessions' and I was just using 'sesson' because that's what you had in your code. Maybe worth trying :controller => 'sessions' if you're getting an error "uninitialized constant SessionController". Otherwise it would be useful to know how it is failing.
Shadwell
+9  A: 

Remove the public/index.html from your rails application and Change your routes.rb

map.root :controller => 'session', :action => 'new'

YetAnotherCoder
Didnt Work ... What can I do ?
Code Burn
use map.root :controller => 'sessions', :action => 'new' since your following tat railcasts video , If still doesnt work check out with the folder permissions and try executing ruby script/server instead of script/server , Good lucj
YetAnotherCoder
A: 

have you got

before_filter :login_required

in every controller that requires authentication. Also as Srinvis mentions above if you are getting a "Welcome aboard You’re riding Ruby on Rails!" message you need to delete the public/index.html file. Make sure its deleted from the filesystem and not just textmate (if your using textmate that is)

ADAM