I have a login with a model of “users”, which I’ve been able to get
working, with one field being “company”. This is a main user who can add
groups, so other group-users can login separately. In the groups table I
have a user_id so I know the connection. When I have a login form for
groups where I’ve added three fields; company, username and password.
What I don’t know is how I define the company field? Is this right?
<%= text_field “group”, “user.company” %>
<label for="group_username">Login</label> <%= text_field "group", "username" %><br/> <label for="group_password">Password</label> <%= password_field "group", "password" %><br/>
How do I refere to in the login action and authenticate? And when doing
a validate with validates_presence_of?