[Rails] Re: Re: Sign up (create account, create user)
> 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."
Account has many Users
User belongs to Account
Think of the Account class as a Company class or a Business class. The
users belong to the Account, Business or Company (whatever you want to
call it). Let's say the account is like the company, and it contains
address, website, phone, fax.
So when somebody opens up an account using the sign up form it fills out
fields like this:
*First name (User class)
*Last name (User class)
*Company (Account class)
*Username (User class)
*Password (User class)
*Application Address http://______.application.com (Account class)
So I created a Signup controller. When submitting the sign up form, both
an Account object and an User object have to be created. Since User
belongs to Account. The newly created account.id has to be entered in
user.account_id
That's why I'm saying that I have to create an Account and a User using
the same controller and reference the User to the Account.
> Also built in.
>
> You can add Devise to an existing model, and it just works. Or use the
> devise generator to make a new model with all the trimmings.
For sure will take a look at it tomorrow early morning :D
Thanks
--
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@googlegroups.com.
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home