Skip to content

Doesn't work on Heroku by default #12

Description

@asgeo1

To get working on Heroku, I had to set the :path in the call to has_attached_file like so:

has_attached_file :avatar,
  :styles => { :medium => '300x280>' },
  :storage => :database,
  :path => ':rails_root/public/system/:class/:attachment/:id_partition/:style/:filename'

It took me a little bit to work that out, as it wasn't really obvious what the issue was. The image would actually upload successfully, and the binary would appear in the image table - but the file_name and content_type properties would be empty so the image couldn't be retrieved via paperclip.

What's weird, is that ":rails_root/public/system/:class/:attachment/:id_partition/:style/:filename" is meant to be the default value for the :path setting anyway according to the paperclip documentation.

Is this something that needs to be fixed in paperclip_database?

If not, maybe add a note about setting the :path to the README?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions