Devise is the most awesomist (yes, its a word) authentication plugin for rails. I have a scenario where, when the user registers they can also enter an organization. I have a clinical application where there is an admin who will have the ability to create users, so the initial user who creates an account (and an org) will then be able to create users who will also be associated with that org. Also, I wanted to do this without adding, modifying the devise registration controller.
Enough talk, heres the code. If you need tips on getting started with devise check out Ryan Bates screencasts here:
Here are my models: https://gist.github.com/1336517
Couple things to note here. I think the belongsto and nestedattribs is pretty straightforward. However, also note the :organizationattributes added to attraccessible.
Here is my view: https://gist.github.com/1336513