Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 884405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:44:42+00:00 2026-05-15T12:44:42+00:00

I am using Heroku for my production environment so I need to load the

  • 0

I am using Heroku for my production environment so I need to load the paperclip files into different directories.

For development I want it to continue in the current /system default, and in production I want to pass the :path variable to a /tmp directory per Heroku.

How do I do this? Am guessing maybe set something in the environments/production.rb file as a variable for the :path but I’d like to see explicitly how to do it the right way.

Thanks.

Here is a snippet from my controller to create the model after passing the file through a multipart form:

def create
    @contact = Contact.create(params[:contact])

     unless @contact.vcard.path.blank?

           paperclip_vcard = File.new(@contact.vcard.path) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:44:42+00:00Added an answer on May 15, 2026 at 12:44 pm

    In the model holding the attached file there’s a method you say it holds that file and some options, etc. In that method you can pass the :path parameter that will tell it where to save it.

    Now is just a matter of checking ENV['RAILS_ENV'] to find out what environment you are and set the path accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to upload a file using paperclip in a production environment in Heroku
I would like to have different applications under the same domain using Heroku. Because
I used Heroku in the past with Rails 3.0.9 using sqlite3 in development (locally).
I have a rails app running on Heroku. I am using paperclip for some
I'm using sendgrid on heroku to send email in production, but would like to
How should my database.yml production look like when I am using Heroku and Amazon
So I have two heroku apps: http://production-app.com (mapped from http://production-app.heroku.com ) http://development-app.heroku.com On production-app.com
I'm using SASS files in Rails development. And I wonder if I should gitignore
I am using Heroku and Amazon S3, for storage. I'm trying to make the
I'm using heroku as my host..It was working fine. Then I installed action_mailer_tls and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.