我有这样的东西:f.collection_select with options
我需要修改该 collection_select 的标准行为(我需要在那里添加一些选项)
我应该在哪里做?
我认为这段代码不起作用,但你会理解这个想法
def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
if options[:create_div]
return '<div>' + @template.collection_select(@object_name, method, collection, value_method, text_method, objectify_options(options), @default_options.merge(html_options)) + '</div>'
end
@template.collection_select(@object_name, method, collection, value_method, text_method, objectify_options(options), @default_options.merge(html_options))
end