我爲我的表單使用了simple_form,並希望在文本字段上啓用一些基本的JS字符計數。如何在simple_form中實現基本字符計數器?
我的形式部分看起來像這樣:
<%= simple_form_for(@post, html: {class: 'form-horizontal' }) do |f| %>
<%= f.error_notification %>
<%= f.input_field :parent_id, as: :hidden %>
<div class="field">
<% if can? :manage, @post %>
<%= f.input_field :status, label: "Status", collection: Post.statuses.keys, selected: :unconfirmed %>
<% end %>
</div>
<%= f.input :title, placeholder: "Enter Title" %>
<%= f.input :photo %>
<%= f.input :file %>
<%= f.input :body %>
<div class="report-submit">
<%= f.button :submit %>
</div>
<% end %>
我如何去這樣做呢?
哪裏是大文本字段? – RSB 2014-09-02 09:34:51
@RSB'f.input:body'。 – marcamillion 2014-09-02 09:36:02