Skip to content
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

Add doc about I18n support for :placeholder option [ci skip] #37054

Merged

Conversation

@sinsoku
Copy link
Contributor

@sinsoku sinsoku commented Aug 27, 2019

The :placeholder option accepts true, so it should be mentioned in the documentation.

Ref: #16438

@rails-bot rails-bot bot added the actionview label Aug 27, 2019
@@ -165,7 +165,7 @@ def select_tag(name, option_tags = nil, options = {})
# * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
# * <tt>:size</tt> - The number of visible characters that will fit in the input.
# * <tt>:maxlength</tt> - The maximum number of characters that the browser will allow the user to enter.
# * <tt>:placeholder</tt> - The text contained in the field by default which is removed when the field receives focus.
# * <tt>:placeholder</tt> - The text contained in the field by default which is removed when the field receives focus. If set to true, use a translation is found in the current I18n locale (through helpers.placeholders.<modelname>.<attribute>).

This comment has been minimized.

@eileencodes

eileencodes Aug 27, 2019
Member

Can you fix this to wrap at 80 characters? Don't update the rest of the file, just the new docs you added. Thanks!

This comment has been minimized.

@sinsoku

sinsoku Aug 27, 2019
Author Contributor

Thank you for your review. I added a line break and did fource-push.

The :placeholder option accepts true, so it should be mentioned in the documentation.

Ref: #16438
@sinsoku sinsoku force-pushed the sinsoku:patch/add_doc_for_placeholder_option branch from b7d6a84 to 7b157f1 Aug 27, 2019
@eileencodes eileencodes merged commit ead5331 into rails:master Aug 27, 2019
1 check passed
1 check passed
codeclimate All good!
Details
eileencodes added a commit that referenced this pull request Aug 27, 2019
…option

Add doc about I18n support for :placeholder option [ci skip]
eileencodes added a commit that referenced this pull request Aug 27, 2019
…option

Add doc about I18n support for :placeholder option [ci skip]
@eileencodes
Copy link
Member

@eileencodes eileencodes commented Aug 27, 2019

Backported to 6-0-stable and 5-2-stable

@@ -166,6 +166,8 @@ def select_tag(name, option_tags = nil, options = {})
# * <tt>:size</tt> - The number of visible characters that will fit in the input.
# * <tt>:maxlength</tt> - The maximum number of characters that the browser will allow the user to enter.
# * <tt>:placeholder</tt> - The text contained in the field by default which is removed when the field receives focus.
# If set to true, use a translation is found in the current I18n locale

This comment has been minimized.

@sharang-d

sharang-d Aug 27, 2019
Contributor

use a translation is found in
->
use the translation found in

JesseChavez added a commit to JesseChavez/rails that referenced this pull request Dec 19, 2019
…lder_option

Add doc about I18n support for :placeholder option [ci skip]
vbalazs added a commit to vbalazs/rails that referenced this pull request Nov 3, 2020
When placeholder set to true on `text_field_tag`, it will try to look up its value from the translation files.
The documentation referenced an incorrect translation key scope, it is defined in [Placeholderable][1] as `helpers.placeholder` (singular).

Followup for rails#37054

[1] https://github.com/rails/rails/blob/4640cff2b2c920adc372bbb60809d2a0a9b6d62a/actionview/lib/action_view/helpers/tags/placeholderable.rb
vbalazs added a commit to vbalazs/rails that referenced this pull request Nov 3, 2020
When placeholder set to true on `text_field_tag`, it will try to look up its value from the translation files.
The documentation referenced an incorrect translation key scope, it is defined in [Placeholderable][1] as `helpers.placeholder` (singular).
Followup for rails#37054

Also improves wording.

[1]: https://github.com/rails/rails/blob/4640cff2b2c920adc372bbb60809d2a0a9b6d62a/actionview/lib/action_view/helpers/tags/placeholderable.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.