input_field doesn't use I18n placeholder #632

Closed
nashby opened this Issue Jul 22, 2012 · 6 comments

Projects

None yet

4 participants

@nashby
Collaborator
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
Collaborator

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
92585eb
@nashby
Collaborator
nashby commented Jul 22, 2012

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

@sevenseacat

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

Conflicts:

	lib/simple_form/form_builder.rb
88f6ae0
@nashby nashby added a commit that closed this issue Jan 29, 2013
@nashby nashby add components that don't generate tags for input_field
closes #632

Conflicts:

	lib/simple_form/form_builder.rb

Conflicts:

	lib/simple_form/form_builder.rb
b0e8d1f
@nashby nashby closed this in b0e8d1f Jan 29, 2013
@nirvdrum

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

@nashby
Collaborator
nashby commented Mar 22, 2013

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

@nirvdrum

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