Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.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 在哪里插入类?_Ruby On Rails_Ruby - Fatal编程技术网

Ruby on rails 在哪里插入类?

Ruby on rails 在哪里插入类?,ruby-on-rails,ruby,Ruby On Rails,Ruby,我是rails新手,对于选择选项的类:'custom-select'应该放在哪里,我感到非常困惑 <%= form.select(:category_id, options_for_select(@categories)) %> 它去哪里了 提前感谢您。HTML哈希是select tag helper方法中的第四个参数 <%= form.select(:category_id, options_for_select(@categories), {}, class: 'cu

我是rails新手,对于选择选项的
类:'custom-select'
应该放在哪里,我感到非常困惑

<%= form.select(:category_id, options_for_select(@categories)) %>

它去哪里了


提前感谢您。

HTML哈希是select tag helper方法中的第四个参数

<%= form.select(:category_id, options_for_select(@categories), {}, class: 'custom-select') %>

HTML哈希是select tag helper方法中的第四个参数

<%= form.select(:category_id, options_for_select(@categories), {}, class: 'custom-select') %>


NP-参数如下:
select(object,method,choices=nil,options={},html\u options={},&block)
NP-参数如下:
select(object,method,choices=nil,options={},html\u options={},&block)
这个问题已经存在。这个问题已经存在。