diff options
author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-10-25 16:36:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 16:36:37 -0400 |
commit | 3f8b1353c64825fb665f3ab0c06d3616dc56b6fe (patch) | |
tree | 5b9f35482eeff04e65dada854d305a7cd79a85c5 /actionview/lib/action_view/helpers | |
parent | c4fd38a206a82323b14ad41550f04a2258af955a (diff) | |
parent | 5edbc1fd2034f79e41638d8e67324c7d357002d6 (diff) | |
download | rails-3f8b1353c64825fb665f3ab0c06d3616dc56b6fe.tar.gz rails-3f8b1353c64825fb665f3ab0c06d3616dc56b6fe.tar.bz2 rails-3f8b1353c64825fb665f3ab0c06d3616dc56b6fe.zip |
Merge pull request #34313 from GeniusStorm/add_maxlength_to_textfield_doc
Add maxlength attribute usage example to Text Field Api documentation
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r-- | actionview/lib/action_view/helpers/form_helper.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index 6e769aa560..c2caa77afb 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -1130,6 +1130,9 @@ module ActionView # text_field(:post, :title, class: "create_input") # # => <input type="text" id="post_title" name="post[title]" value="#{@post.title}" class="create_input" /> # + # text_field(:post, :title, maxlength: 30, class: "title_input") + # # => <input type="text" id="post_title" name="post[title]" maxlength="30" size="30" value="#{@post.title}" class="title_input" /> + # # text_field(:session, :user, onchange: "if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }") # # => <input type="text" id="session_user" name="session[user]" value="#{@session.user}" onchange="if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }"/> # |