0
我想通過屬性設置將它們分配給我的產品屬性,即我將Size設置爲屬性集並希望在其下分組Small,Medium,Large等。如何按列分組收藏
這是我目前擁有的代碼,但我得到了一些錯誤
- Property.all.group_by(&:property_set_id).each do |property_set, properties|
h3= property_set.name
- properties.each do |property|
= property.property_set.name
.property_form.left.span-9.last
- checked = property_set.name && property_set.properties.include?(property)
label.mdl-switch.mdl-js-switch.mdl-js-ripple-effect for=property.name
= check_box_tag "prototype[property_ids][]", property.id, checked, :class => 'mdl-switch__input', :id => property.name
span.mdl-switch__label= property.name
def edit
@properties = Property.all
@property_set = PropertySet.includes(:properties).find(params[:id])
end