ruby on rails - Buttons (toggle buttons?) instead of radio buttons in an ActiveRecord form using bootstrap? -
i want have selector "priority" on form looks this: 
but can't figure out how link activerecord. straight-html "toggle buttons":
<div class="btn-group"> <a class="btn" href="#"><i class="icon-arrow-down"></i> low</a> <a class="btn btn-warning active" href="#"><!-- class="icon-white icon-adjust"></i--> medium</a> <a class="btn" href="#"><i class="icon-arrow-up"></i> high</a> </div> and i've got working radio buttons, thinking maybe can style them regular inline buttons. not sure if can specify class each button without jquery:
<%= f.collection_radio_buttons :priority, [["c - low", 'low'], ["b - medium", 'medium'], ["a - high", 'high']], :first, :last %> any ideas on how make buttons active 1 pressed in?
ended using hidden input field binded directly priority column in database:
<%= f.input :priority, as: :hidden %> then using jquery make buttons clickable (and change value in hidden field).
Comments
Post a Comment