Question

I need a simple_form that has options 1-10. I was trying the following:

 <%= f.collection_radio_buttons :cost, [1..10] %>
Was it helpful?

Solution

Suppose this would work as well.

<%= f.input :cost, collection: (1..10), as: :radio_buttons, boolean_style: :inline %>

OTHER TIPS

So easy:

 <%= f.input :cost, collection: [1,2,3,4,5,6,7,8,9,10], as: :radio_buttons, boolean_style: :inline %>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top