我在这里做错了什么:
def radio_button(label, *args)
options = args.extract_options!
collection = options[:collection]
options.delete :collection
# put back into args to pass to super
args << options
collection.each do |item|
label(label, class: "radio-inline") do
super(label, item, *args) do
item.to_s.humanize
end
end
end
end
我打电话给它
= f.radio_button :receiving_treatment, collection: ["yes", "no"], required: true
它只是输出 ["yes", "no"]