Setting a root_url

I know how to setup a roo_url using map.root in “routes.rb”.

The issue I’m currently having is as follows:

I walking through this Rails cast regarding Authlogic:

I decided that I make my map.root the “login” page, that is, the
index.html.erb of the user_sessions_controller.

So, what I did is typed the following in the “routes.rb”:

map.root :controller => “user_sessions”

But, get the following: http://pastie.org/1050272

When I changed:

@user_sessions = UserSession.all

To:

@user_sessions = UserSession.find[:all], I got the following:
http://pastie.org/1050274

Provided that, for example I have a users_controller, and when in
“routes.rb” I do:

map.root :controller => “users”, I get the expected output and it works
fine.

Isn’t that weird?

Appreciate your support on this.

post your user_sessions_controller.rb

the problem is here:
/Users/abder/Desktop/inventroy_authentication/app/controllers/user_sessions_controller.rb:5:in
`index’

2010/7/19 Abder-Rahman A. [email protected]

To:
Isn’t that weird?

Appreciate your support on this.

Posted via http://www.ruby-forum.com/.


You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Thanks. Attached you can find the user_sessions_controller.rb file.

creat one method index with a list to all users and one index.html.erb
in
app/views/user with a list too.

2010/7/19 Abder-Rahman A. [email protected]

Luciano S. wrote:

creat one method index with a list to all users and one index.html.erb
in
app/views/user with a list too.

2010/7/19 Abder-Rahman A. [email protected]

Thanks Luciano.

Do you mean in the index method a list to all user sessions? Such as:

@user_session = UserSession.all

Thanks.

Luciano S. wrote:

exactly
try it and say it did.

2010/7/19 Abder-Rahman A. [email protected]

Thanks Luciano. Sorry, it seems I sent the wrong
user_sessions_controller.rb, but still getting the same issue I
mentioned.

This is the user_sessions_controller.rb I have.

What do you think?

exactly
try it and say it did.

2010/7/19 Abder-Rahman A. [email protected]