ActionView FormHelper Input with data behavior HTML 选项
ActionView FormHelper Input with data behavior HTML options
我的表单标签看起来像
<%= form_for [ conversation, Message.new ], remote: true do |form| %>
<%= form.text_area :body %>
<%= form.submit 'Send' %>
<% end %>
如何添加此 HTML 数据选项:
<input data-behavior="message_speaker">
到 form.text_area
元素?
<%= form.text_area :body, :class => 'form-control', data: { behavior: "message_speaker" } %>
我的表单标签看起来像
<%= form_for [ conversation, Message.new ], remote: true do |form| %>
<%= form.text_area :body %>
<%= form.submit 'Send' %>
<% end %>
如何添加此 HTML 数据选项:
<input data-behavior="message_speaker">
到 form.text_area
元素?
<%= form.text_area :body, :class => 'form-control', data: { behavior: "message_speaker" } %>