login community 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 Jul 07 '12 at 14:28

evan's gravatar image

evan
11

edited Jul 07 '12 at 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.

answered Jul 07 '12 at 19:16

johns's gravatar image

johns ♦♦
340427

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.

(Jul 08 '12 at 14:53) evan evan's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
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

Tags:

×127
×90
×76
×17
×17

Asked: Jul 07 '12 at 14:28

Seen: 571 times

Last updated: Jul 08 '12 at 14:53

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited