Keith Raymond
2010-Sep-02 23:16 UTC
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. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Fernando Perez
2010-Sep-04 22:18 UTC
Re: Authlogic user login and register new user side-by-side
> 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 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.