How can I add a title tag and change size option to a form field in rails?
The following ruby code in my view is like this:
<%= f.t开发者_如何学Goext_field :email, :class => '' %>
It renders like this:
<input class="" id="user_email" name="user[email]" size="30" type="text" />
I want to be able to change the size and add a title tag which would look like this:
<input class="" id="user_email" name="user[email]" size="40" title="Your Email" type="text" />
For size, do :size => 40
You could try the same for :title
, but I've never seen it used.
<%= f.text_field :email, :class => '', :size => 40, :title => 'whatever' %>
Like I said, not sure if the title hash works.
精彩评论