-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 4 branch -- "for" attribute on form labels #846
Comments
That's interesting...We have specs that cover this behaviour https://github.com/plataformatec/simple_form/blob/master/test/inputs/datetime_input_test.rb#L65-L92 BTW, not sure about rails4 branch. Looks like we don't have it anymore. Could you please test it against master branch of SimpleForm? |
Apologies, the described behavior was not with a rails4 branch, it's with master:
|
@mjankowski could you please run this code in console? I18n.t('date.order') looks like you don't have this key. |
Sure, I see:
|
I see. In rails 3.2 that code returns an array of symbols and in rails 4 it's an array of strings so we can't fetch the correct position here https://github.com/plataformatec/simple_form/blob/master/lib/simple_form/inputs/date_time_input.rb#L19 |
rails/rails@6bb784e this. Well I think we should change SimpleForm's code too. |
👍 we can try fetching both symbol and string for now I guess. |
I think that the hash keys in A solution might be to change line 19 in date_time_input to be:
...but I'm not sure where to add test coverage. There are four tests in datetime_input_test which assume that |
Since SimpleForm 3.0 will support only Rails 4+ I think we should change all that tests to use strings. @carlosantoniodasilva right? |
PR: #848 |
@nashby seems fine yeah. |
(Just one thing to always keep in mind: users might still have the symbols in their locale files.) |
Here's some output from a Rails 3.2 app with simple_form:
Here's the same output from the same app on a rails4 upgrade branch, using the simple_form rails4 branch:
Note the difference there -- the
for
value of the surroundinglabel
element has changed fromuser_date_of_birth_1i
in the rails 3 app touser_date_of_birth_i
in the rails4 app.It's not clear to me if this:
This change has the effect of making "click to focus" in browsers no longer work on these form elements, and of breaking tests which rely on capybara
find_field
, and the like.The text was updated successfully, but these errors were encountered: