Skip to content

Instantly share code, notes, and snippets.

@staycreativedesign
Created May 11, 2020 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staycreativedesign/36dfb492ee450802e3558d79a014ed96 to your computer and use it in GitHub Desktop.
Save staycreativedesign/36dfb492ee450802e3558d79a014ed96 to your computer and use it in GitHub Desktop.
Document(#70259050585960) expected, got "" which is an instance of String(#70259013172680)
class Notification < ApplicationRecord
has_and_belongs_to_many :documents
has_many :users
has_many :marketers
end
class Document < ApplicationRecord
belongs_to :document_category
has_one_attached :file
has_and_belongs_to_many :notifications
end
class NotificationsDocuments < ApplicationRecord
belongs_to :document
belongs_to :notification
end
= f.select(:documents, options_from_collection_for_select(Document.all, 'id', 'name', f.object.documents), {}, multiple: true, class: 'select2 form-control')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment