未验证 提交 3f8b1353 编写于 作者: G Gannon McGibbon 提交者: GitHub

Merge pull request #34313 from GeniusStorm/add_maxlength_to_textfield_doc

Add maxlength attribute usage example to Text Field Api documentation
......@@ -1130,6 +1130,9 @@ def label(object_name, method, content_or_options = nil, options = nil, &block)
# 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!'); }"/>
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册