Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/54.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 自定义formtastic以添加<;a>;在一些列表元素中_Ruby On Rails_Ruby On Rails 3_Formtastic - Fatal编程技术网

Ruby on rails 自定义formtastic以添加<;a>;在一些列表元素中

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

我需要在formtastic表单中添加一些扩展面板,因此当用户单击“+”时,会显示一个隐藏面板,并提供有关该字段的更多信息

这是一个标准formtastic字段:

<%= 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的代码一点也不熟悉。如何做到这一点