Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I save the user_id by adding the mail?

Nicolás Bobb asked in Rails

How do I save the user_id by adding the mail?

For the relationship, you have to save the user_id, but to be more dynamic for the user, I want to the users search other users by the email and rails save the id as usual.

How is it done?

In the views I have:

 <div class = "field">
     <% = form.label: user_id%>
     <% = form.text_field: user_id, id%>
   </ div>

 I'm using Devise.

Reply

Thanks Jack! As you said, I solve it

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.