I am using Rails 3.0.1 with Devise for user authentication. I am trying Rails out so if the answer is blindingly obvious please bear with me. I have an index page, which has links to the sign up/sign in forms. All the logic works fine but what I can''t work out is how to display the forms in the index page rather than opening the forms and losing the formatting of the index page. Here''s the code (I''m using HAML which I know not everyone likes !) .box - if user_signed_in? Signed in as #{current_user.email}. .quiet Not you ? \#{link_to "Sign out", destroy_user_session_path} - else = link_to "Sign up", new_user_registration_path or \#{link_to "Sign in", new_user_session_path} So what I''m trying to do is once the link is clicked, the relevant form is displayed in the .box div rather than on a new page. Any tips or pointers would be gratefully received. Thanks -- 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.
On Nov 7, 1:52 pm, Kellsborojack <kellsboroj...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So what I''m trying to do is once the link is clicked, the relevant > form is displayed in the .box div rather than on a new page.I think the simplest way would be to just output all the HTML on the page, then just hide or show the proper divs using JavaScript. Hide the form div by default, then have the "sign up" or "sign in" links hide/show the proper divs: #links.box ...etc... #login.box{:style=>"display:none;"} ...etc... Then calling the following function will hide the links and show the login form. $(''links'', ''login'').invoke(''toggle''); -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.