خرید بک لینک

Vote count: 0

Question about Rails 5 and collection_radio_buttons.

How do you have it display the checked value of a radio input when you try and edit the form?

<%= collection_radio_buttons(:post, :category_id, Category.all, :id, :name) do |b| %>
  <div class="radio">
     <%= b.label do %>
       <%= b.radio_button + b.text %>
     <% end %>
  </div>
<% end %>

With select box f.collection_select it remembers the value but not with collection_radio_buttons

asked 24 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 5 مرداد 1395 ساعت: 12:39

صفحه بندی