Skip to content

undefined method `first' for #<ActionDispatch::Http::UploadedFile:0x00000109915b68> #34

Description

@sairamc

class Item
include Mongoid::Document
field :name, type: String
field :description, type: String

embeds_many :photos, cascade_callbacks: true
accepts_nested_attributes_for :photos
end

class Photo
include Mongoid::Document
include Mongoid::Paperclip

embedded_in :items, :inverse_of => :photos

has_mongoid_attached_file :attachment,
:storage => :s3,
:bucket => APP_CONFIG[:amazon_s3_photos_bucket],
:styles => {
:original => ['1920x1680>', :jpg],
:small => ['100x100#', :jpg],
:medium => ['250x250', :jpg],
:large => ['500x500>', :jpg]
},
:convert_options => { :all => '-background white -flatten +matte' }
end

I'm seeing undefined method `first' for #ActionDispatch::Http::UploadedFile:0x00000109915b68 error when I try to save the Item..

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions