rails 4 bootstrap group buttons with acts as taggable on edit, not pushed down
I'm using acts as taggable on gem and I'm trying to create a nice looking group button, but it doesn't stay marked if I'm editing the form. I know that the database did indeed save the value. I can even change the value and save when I edit, but when I go back to the edit button, it doesn't show which button got saved.
.btn-group{ data: { toggle: "buttons" } }
- ["Value1", "Value2", "Value3"].each do |item|
= f.label item, class: "btn btn-default" do
= f.radio_button :tag_list, item
= item
Looks like this:
Would like to have this on edit:
Am I missing a simple method that will show what the value is?
将checked
属性添加到您的radio_button
:
= f.radio_button :tag_list, item, checked: f.object.tag_list.include?(item)
链接地址: http://www.djcxy.com/p/6114.html
上一篇: Mdbg,Dbgclr,Cordbg