WebFaction
Community site: login faq

I have a Rails 3 application on WebFaction, and would like to use a separate Static-only application to serve its media to save memory and time.

I found a WebFaction guide for doing this with Django, but not with Rails. I was able to create a Static-only application and update the Rails site’s website record to use the static media application, based on the first three steps of those Django instructions. However, I am not sure how to configure Rails correctly to make use of the files that I copied into my Static-only application.

I would appreciate advice on how to configure Rails to use the Static-only application as the source of images that it would otherwise look for in the Rails application's public folder. I would also like images that users upload, such as avatars, to be stored in the Static-only application's folder. How can I also serve stylesheets and Javascript files from the Static-only application?

Thank you.

asked 07 Jul '12, 14:28

evan
123
accept rate: 0%

edited 07 Jul '12, 14:29


The general process applies for any site,

  1. locate the directory which contains all the images/css/javascript your app uses,
  2. create a 'symbolic link to static only' application, use the path from step 1 as the 'extra info'
  3. Edit your web-site record to intercept the URI to the media files with the new app.

This applies for any website, running any framework. You may submit a support ticket if you would like us to look at your particular setup and make recommendations.

permanent link

answered 07 Jul '12, 19:16

johns
5.4k312
accept rate: 23%

Thank you, johns. That gave me enough information to get started. I think that I will also need to make changes to the configuration file that controls Rails' asset pipeline for Javascript files and stylesheets, but your answer cleared up how to handle the general process.

(08 Jul '12, 14:53) evan
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×125
×108
×31
×22

question asked: 07 Jul '12, 14:28

question was seen: 3,336 times

last updated: 08 Jul '12, 14:53

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM