Rails simple_form - Align radio buttons vertically

ruby-on-rails, simple-form

Solution

I remember running into the same issue. There probably is a better way to work around it but this worked for me:

<%= f.input :options, collection: [[true, 'Positive'], [false, 'Negative']], as: :radio_buttons, label: 'Emotion', label_method: :last } %>

Hope it helps.

Problem

I have the following code: ``` <%= simple_form_for @comment do |f| %> <%= f.input :comment, label: 'Phrase you would like to add:' %> <%= f.collection_radio_buttons :options, [[true, 'Positive'] ,[false, 'Negative']], :first, :last, label: 'Emotion' %> <% end %> ``` This works fine, but the radio buttons in `collection_radio_buttons` are side by side. How can I stack the radio buttons vertically on top of each other?

Original source