houdini/app/views/components/_radio_set.html.erb

14 lines
456 B
Text

<%# use like this: render 'components/radio_set',
name: 'ticket_payment_method',
radios: ['Credit Card', 'Cash', 'Check'] %>
<%# you can pass in an optional html_class param for styling %>
<%# you can also pass in an optional key for 'def'ing values to it %>
<% html_class ||= '' %>
<% key ||= false %>
<% radios.each do |r| %>
<div class="<%= html_class %>">
<%= render 'components/radio', name: name, label: r, key: key %>
</div>
<% end %>