<fieldset> <legend>Which color do you prefer?</legend> <%= form_for :color do |f| %> <%= radio_button :color, :select, :red %> <%= label :color, :select_red, 'Red' %> <%= radio_button :color, :select, :green %> <%= label :color, :select_green, 'Green' %> <%= radio_button :color, :select, :blue %> <%= label :color, :select_blue, 'Blue' %> <% end %> </fieldset>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter