문제

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

 <%= f.collection_radio_buttons :cost, [1..10] %>
도움이 되었습니까?

해결책

Suppose this would work as well.

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

다른 팁

So easy:

 <%= f.input :cost, collection: [1,2,3,4,5,6,7,8,9,10], as: :radio_buttons, boolean_style: :inline %>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top