vendredi 12 mai 2017

Changing the data of a f.label after the user presses f.submit

So I currently have this code in the html.erb:

<%= f.label :user_id => %>
<%= f.email_field :user_id %>

I want the user to enter an email into the email_field in which it converts it into user_id using this:

User.find_by_email("xyz@abc.com")

However, I have no idea how to use it or know whether this will even work. Will appreciate some help on this as I am quite new to rails. Thanks!

Aucun commentaire:

Enregistrer un commentaire