I have a Product related to sizes by way of has_and_belongs_to_many.
Currently in my product form partial, I have this really ugly (although
functional) code. Note the hanging ">" that closes the "<input>".
<% for size in @sizes %>
id="<%= size.id %>"
value="<%= size.id %>"
<%if @product.sizes.include? size %>checked<%end%>
> <%= size.name %>
<% end %>
Is there a method that will let me do this and have nicer looking code?
I've had a hard time finding it if there is.