mardi 15 novembre 2016

Rails no implicit conversion of Symbol into Array

implicit conversion of Symbol into Array

I'm trying to create a select from a array and is showing this error! someone have any idea why?

Product model

has_many :sizeships
has_many :sizes, through: :sizeships

Size model

has_many :sizeships
has_many :products, :through => :sizeships

Product controller

def show
@sizes_for_dropdown = @product.sizes.product(:name).collect{ |co| [co.size, co.id]}
end

Aucun commentaire:

Enregistrer un commentaire