undefined method '<<' for polymorphic association

class Item < ApplicationRecord has_many :pictures, as: :imageable end

class Picture < ApplicationRecord

belongs_to :imageable, polymorphic: true, optional: true end

NoMethodError

in PicturesController#create

undefined method `<<’ for #Picture:0x007f3758cc88f0

@item.pictures.create << @picture

You can do @item.pictures << @picture