【发布时间】:2014-03-14 17:37:02
【问题描述】:
您好,我正在尝试更改以下内容:
.form-group
= label_tag :metric, 'Metric', class: 'sr-only'
= select_tag :metric, options_for_select(Report::METRICS, selected: @report.metric), class: 'form-control'
类似于以下内容:
.form-group.pull-left
= label_tag :metric, 'Metric', class: 'sr-only'
.btn-group{"data-toggle" => "buttons"}
%label.btn.btn-default.active
%input#option1{name: "options", type: "radio", value: "value1"}/
Value1
%label.btn.btn-default
%input#option2{name: "options", type: "radio", value: "value2"}/
Value2
但是问题是,当我提交表单时,它实际上并没有提交单选按钮值。同样在提交后,当它应该保留在选定的单选按钮上时,它默认返回为无选择。
【问题讨论】:
标签: ruby-on-rails twitter-bootstrap twitter-bootstrap-3 haml