Domanda

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

 <%= f.collection_radio_buttons :cost, [1..10] %>
È stato utile?

Soluzione

Suppose this would work as well.

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

Altri suggerimenti

So easy:

 <%= f.input :cost, collection: [1,2,3,4,5,6,7,8,9,10], as: :radio_buttons, boolean_style: :inline %>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top