`:autofocus => true` becomes `autofocus='autofocus'` in the html (which doesn't work)

324 views
Skip to first unread message

chadoh

unread,
Jan 19, 2011, 8:22:41 AM1/19/11
to plataformate...@googlegroups.com
I am trying to use the html5 "autofocus" attribute.

= f.input :email, :required => false, :input_html => { :autofocus => true }
= f.input :email, :required => false, :input_html => { :autofocus => "true" }

Both result in 

<input autofocus="autofocus" class="string email optional" id="person_email" maxlength="255" name="person[email]" size="50" type="email">

What do I need to do here? Report a bug?

Also, html5 doesn't require even having the "='true' "; I should just be able to put "autofocus". Any plans to support that? 

Rafael Mendonça França

unread,
Jan 19, 2011, 8:27:18 AM1/19/11
to plataformate...@googlegroups.com
You can report this issue on github. I will provide a patch for this.

Rafael Mendonça França
Twitter: http://twitter.com/rafaelfranca
Blog: www.rafaelfranca.com.br

Rafael Mendonça França

unread,
Jan 19, 2011, 8:43:25 AM1/19/11
to plataformate...@googlegroups.com
Oh.


I think that you will have to create a issue in Rails.

Rafael Mendonça França
Twitter: http://twitter.com/rafaelfranca
Blog: www.rafaelfranca.com.br


Carlos Antonio da Silva

unread,
Jan 19, 2011, 8:50:19 AM1/19/11
to plataformate...@googlegroups.com
Right, this is a Rails issue. Rails converts boolean attributes (such as checked and disabled) to this format, that was the default for the attributes so far.

Thanks guys.
--
At.
Carlos A. da Silva

chadoh

unread,
Jan 24, 2011, 8:42:57 AM1/24/11
to plataformate...@googlegroups.com
Dang. Thanks for info. I'll take it up with the Rails team.
Reply all
Reply to author
Forward
0 new messages