Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

input_field doesn't use I18n placeholder #632

nashby opened this Issue Jul 22, 2012 · 6 comments


None yet
4 participants

nashby commented Jul 22, 2012

@carlosantoniodasilva as you asked in #531 I've created a new issue.

So do you mean f.input_field should use placeholder component when we even use it without f.input do?

<%= simple_form_for(@user) do |f| %>
  <%= f.input_field :name %>
<% end %>

should it generate html with placeholder from locales? If so I think we can add :placeholder component to that wrapper https://github.com/plataformatec/simple_form/blob/master/lib/simple_form/form_builder.rb#L136. wdyt?


rafaelfranca commented Jul 22, 2012

If we are going to add the placeholder component to the input_field wrapper, I think we should add the others components that do not generate tags. E.g. min_max, maxlength, etc.

@nashby nashby added a commit to nashby/simple_form that referenced this issue Jul 22, 2012

@nashby nashby add components that don't generate tags for input_field
closes #632

nashby commented Jul 22, 2012

if it's easy as I think here is a PR - #633

Arr, this has just tripped me up, +1 to fixing this.

@nashby nashby added a commit that referenced this issue Jan 29, 2013

@nashby nashby add components that don't generate tags for input_field
closes #632



@nashby nashby closed this in b0e8d1f Jan 29, 2013

This looks like it reintroduced the problem in #310 in simple_form 2.1.0.


nashby commented Mar 22, 2013

Can you please provide a sample application that reproduces the error?

I'll try to get something together this weekend. But basically it's a User model with an email field using Authlogic's email regexp to validate the format of. That regexp format is not compatible with JavaScript's format, but as of simple_form 2.1.0, it's being passed through as the "pattern" attribute to any input field tied to the user email attribute.

As a result, valid email addresses will not validate in the email field. Since the email field already validates email addresses, specifying the pattern in this case seems superfluous anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment