Rails: How "email_field" differs from "text_field"?

Misha Moroshko picture Misha Moroshko · Feb 6, 2011 · Viewed 7.3k times · Source

I understand that text_field creates an input field of type text, while email_field creates an input field of type email.

But, what is the difference between these two input types ?

Say I have a client model while a client has an email. Should I use email_field here ?

Answer

vise picture vise · Feb 6, 2011

The email field is the new html 5 input which right now behaves the same on most of the machines with the exception of a few mobile devices such as the iphone where it switches to a different keyboard.

You can find more about it by googling html5 email field.

It's just a touch of finesse which some users will appreciate.