On Oct 21, 2010, at 9:45 AM, Leonel *.* wrote:

Walter Davis wrote in post #956070:
On Oct 20, 2010, at 11:36 PM, Leonel *.* wrote:

Your Accounts will have usernames and e-mail addresses?  Why?
Those properly belong to Users.

Am I misunderstanding?
Yes, a little bit :P Like I said above...
"The user that signs up and creates the account is the admin user for
the
account. Then, he can send email invitations to his staff (users) to
also use the application."

You really want to use Devise and Devise Invitable for this. You just
described the last site I built with this combination EXACTLY, and the
one before that almost the same (restricted invitations to members of
the Sales team). There is one User model, with Devise and Invitable in
it. Practices (it's a medical device site) are validated to have a
unique name. The first User to register a Practice becomes its owner,
and can then access the invitation page to send keys to other people
by entering their e-mail address. But I didn't have to make any extra
controllers  for this, just follow the fall-line of the Devise and
invitable instructions. When I wanted additional fields in my
database, I just rolled a new migration and modified the views.
Everything else was taken care of for me.

Awesome! Thanks, I was actually watching the Railscast when I noticed I
had an email notification of a forum post. So Devise will help me not
only for authentication (logging in) but also on forms that CREATE
ACCOUNTS and users????

That's exactly what it's for. Instead of just handling the authentication side of things at a back-end level, it creates a complete login, logout, forgot my password, remember me on this computer, etc. system for you. There are about a dozen different things you can enable or disable in your devise call in the model, and there are tons of third-party add-ons you can install (like Invitable) that do specific things you might need, like authenticate against Facebook (ewww) or whatever your heart or client desires. If you use the rake task to unpack the views, you'll see that it makes a whole flotilla of views for you, and anything you do to those (and the db, naturally) will just magically work for you. You don't have to unpack them if you don't want to, but it helps to see what goes where.

Walter

--
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to