@item.pictures.create << @picture
class Item < ApplicationRecord has_many :pictures, as: :imageableendclass Picture < ApplicationRecord belongs_to :imageable, polymorphic: true, optional: trueend
undefined method `<<' for #<Picture:0x007f3758cc88f0>@item.pictures.create << @picture
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1ad30bf7-4b54-49e7-86ab-8544049e567c%40googlegroups.com.