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

**URL:** <https://www.ruby-forum.com/t/authlogic-user-login-and-register-new-user-side-by-side/194359>\
**Category:** Rails\
**Created:** [September 3, 2010, 1:16am UTC](https://www.ruby-forum.com/t/authlogic-user-login-and-register-new-user-side-by-side/194359 "2010-09-03T01:16:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/839c29/32.png) [@krat](https://www.ruby-forum.com/u/krat)\
**Post date:** [September 3, 2010, 1:16am UTC](https://www.ruby-forum.com/t/authlogic-user-login-and-register-new-user-side-by-side/194359/1 "2010-09-03T01:16:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![krat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/839c29/32.png) [@krat](https://www.ruby-forum.com/u/krat)\
**Post date:** [September 5, 2010, 12:18am UTC](https://www.ruby-forum.com/t/authlogic-user-login-and-register-new-user-side-by-side/194359/2 "2010-09-05T00:18:30Z")

</div>

> 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: [Log In ‹ suivauto — WordPress](http://suivauto.com/login)
