0

As of right now, the code for the relevant section:

= form_for(resource, as: resource_name, url: registration_path(resource_name), html:{id:'registration-form'}) do |f|
    = devise_error_messages!

    div style="padding:4px"
            = f.email_field :email, autofocus: true, placeholder: "Email address", class:"form-control", style:"height:60px"

And the output is looking like this, which I think is pretty okay:

email address form
(source: trillian.im)

But I'd like to get the Bootstrap 3 envelope Glyphicon in front of the text. I'm brand new to Rails as of this week, and haven't been able to find help for this idea elsewhere. It looks like this post is very close to what I want to do, but I'm not sure how to do that against the f.email_field tag. Thanks to anyone with advice!

Community
  • 1
  • 1
Free
  • 663
  • 9
  • 13

1 Answers1

0

The HTML placeholder attribute only accepts plain text. You can't put any tags in there, which is what you would need in order to do what you want.

You can try putting the icon behind or beside your text field so that it appears to be a place holder instead.

CoolTapes
  • 417
  • 5
  • 14
  • So it would be something more like [the code pasted here](http://pastebin.com/zh7fW5FR)? – Free Oct 15 '13 at 18:11