Authlogic user login and register new user side-by-side

Hello all,

This is my first post in this forum. I’m mostly a Actionscript/Flash
guy but am learning RoR for work and to actually work with a flash game
I’m making.

I was hoping someone could help me with Authlogic.

The gem is working fine and I can login and register new users, but I
was hoping to have one page the the user will land on that will allow
them to login if they have an account or create an account if they
don’t. Seem’s pretty standard, but I am having trouble wrapping my mind
around how to have them both on the same page.

I understand that the ‘new’ user_session is the actual creation of the
session and that the user ‘new’ is creating the user that can create a
‘new’ session, but how will I have them both on the same page?

I was think something like this:

class User < ActiveRecord::Base
acts_as_authentic

has_one :user_session

validates_presence_of :login
validates_presence_of :email

end

and then rendering a partial of the login form on the ‘new’ action of
users. Am I in the right direction?

Thank you for your help in advance.

and then rendering a partial of the login form on the ‘new’ action of
users. Am I in the right direction?

Yes, simply render a partial for registration on login page or
vice-versa.

See this example: http://suivauto.com/login