Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.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 如何在best_in_place gem rails 6中使用引导类?_Ruby On Rails_Best In Place - Fatal编程技术网

Ruby on rails 如何在best_in_place gem rails 6中使用引导类?

Ruby on rails 如何在best_in_place gem rails 6中使用引导类?,ruby-on-rails,best-in-place,Ruby On Rails,Best In Place,我试图在文本字段中提供引导类表单控件,但它不起作用。 代码: :输入%> :select,collection:(博物馆采摘), :gender)),内部_类:“表单控件%> :日期,类别:'datepicker1%> 如何在最佳位置字段中指定引导类?首先,您需要根据输入类型找到引导类。例如,对于文本字段,我们有表单控件类,而对于选择字段,我们有自定义选择类 根据字段类型使用这些类。下面是可能对您有所帮助的代码片段 <td> <%= best_in_place reco

我试图在文本字段中提供引导类
表单控件
,但它不起作用。 代码:


:输入%>
:select,collection:(博物馆采摘),
:gender)),内部_类:“表单控件%>
:日期,类别:'datepicker1%>

如何在最佳位置字段中指定引导类?

首先,您需要根据输入类型找到引导类。例如,对于
文本
字段,我们有
表单控件
类,而对于
选择
字段,我们有
自定义选择

根据字段类型使用这些类。下面是可能对您有所帮助的代码片段

<td>
  <%= best_in_place record, :name, as: :input, inner_class: 'form-control' %> 
</td>
<td>
  <%= best_in_place record, :gender, as: :select, collection: (MUser.pluck(:id, 
 :gender)), inner_class: 'custom-select' %>
</td>


快乐编码:)

@Nitin Srivastava先生,请也检查一下这个。
<td>
  <%= best_in_place record, :name, as: :input, inner_class: 'form-control' %> 
</td>
<td>
  <%= best_in_place record, :gender, as: :select, collection: (MUser.pluck(:id, 
 :gender)), inner_class: 'custom-select' %>
</td>