On 20 October 2010 20:17, Leonel *.* <[email protected]> wrote:
> The application I'm creating works like this:
> There is an account (a company)
> Users belong to the Account (company)
>
> So when somebody wants to sign up and create an account, it should
> create an account, then create a user.
>
> username(User)
> password(Users)
> company(Account)
>
> So I created a Signup controller. I want to add validation but I don't
> have a model (for unique and presence validation)for it because the
> signup controller is supposed to create User and Account.

Is your question how to add validation?  When you say you don't have a
model I presume you mean you do not have a Signup model.  The
validations go with the model that you are writing to so the
validations will be on the User and Account models.  Then when you try
to save them they will fail so you can take appropriate action.

However, as Marnen has said, if you want authentication then I also
suggest looking at Authlogic unless you are just doing this as an
exercise.  There are a lot of pitfalls in authentication that are easy
to fall into and it is an area of the site that can give you big
problems if it is not secure.  There is also devise that has had some
publicity lately but I have not tried it.

Colin

-- 
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