Ruby on rails 自定义formtastic以添加<;a>;在一些列表元素中
我需要在formtastic表单中添加一些扩展面板,因此当用户单击“+”时,会显示一个隐藏面板,并提供有关该字段的更多信息 这是一个标准formtastic字段:Ruby on rails 自定义formtastic以添加<;a>;在一些列表元素中,ruby-on-rails,ruby-on-rails-3,formtastic,Ruby On Rails,Ruby On Rails 3,Formtastic,我需要在formtastic表单中添加一些扩展面板,因此当用户单击“+”时,会显示一个隐藏面板,并提供有关该字段的更多信息 这是一个标准formtastic字段: <%= form.input :name %> # will become... <li class="string input required stringish" id="employee_name_input"> <label class=" label" for="employee_na
<%= form.input :name %>
# will become...
<li class="string input required stringish" id="employee_name_input">
<label class=" label" for="employee_name"> Name </label>
<input id="employee_name" maxlength="255" name="employee[name]" required="required" type="text" value="Joe Bloggs" class="">
</li>
#将成为。。。
名称
我需要对此进行自定义,因此将类添加到“form.input”将创建新元素:
<%= form.input :name, :input_html => {:class => "turn_on_toggler"} %>
# becomes (the 2nd line has been added)...
<li class="string input required stringish" id="employee_name_input">
<a class="toggler expand_collapse"></a>
<label class=" label" for="employee_name"> Name </label>
<input id="employee_name" maxlength="255" name="employee[name]" required="required" type="text" value="Joe Bloggs" class="">
</li>
{:class=>“打开开关”}%>
#变为(已添加第二行)。。。
名称
我对formtastic的代码一点也不熟悉。如何做到这一点