4

I'm currently working on a Rails project and have decided to use Devise for user registration. The site is using MongoDB (mongoid gem), and I am planning to create a simple sign-up/sign-in system.

So, there is a link in the home page that allows the user to click on it or open in another tab. If he decides to click it, there should be a popup modal that contains the fields and sign-up button, etc. If he opens a new tab, he should see a dedicated page for the sign up process.

So, here is what I have so far. I have installed devise and am able to sign up properly. However, I also want to create the modal effect, in which I used jQuery UI dialog attached to the sign-up link. Then I loaded the sign-up page (/user/sign-up) using dialog.load("path") and stripped the layout when it is an ajax request.

I know this is not the best method to use, so I've been reluctant. Is there a better way of doing this? Preferably a standard method. Any help would be appreciated, or just point me to the right direction. Tutorials will be very nice and helpful. Thanks a lot in advance!

gerky
  • 6,267
  • 11
  • 55
  • 82
  • FWIW, that's the method I'd use if I was to do something like that so I'd be very interested in seeing other people's methods too. – Dave A-R Jul 08 '11 at 14:34

1 Answers1

0

I am not sure if I understand the question, but try this. Run

rails generate devise:views

To create the devise views.

In the views/devise/registration folder you will find the registration page. You should now have access to both the form code and the path user_session mapping to /users/sign_in.

You now have the form and the path, so you should be able to play with the AJAXifying it.

Hiltmon
  • 1,265
  • 9
  • 6