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 9125641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:51:04+00:00 2026-06-17T06:51:04+00:00

I have a custom theme for my rails app. This theme consists of 8

  • 0

I have a custom theme for my rails app. This theme consists of 8 folder with complex structure (subfolders, lots of files). One of these folders is bootstrap which consist of css, js and img subfolder. Some other folders and subfolder also contain css, js and imgages.

How can I use assets pipeline to precompile these files and how to access them from code?

  • 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-06-17T06:51:05+00:00Added an answer on June 17, 2026 at 6:51 am

    I recently purchased a large HTML5 theme and performed the work to get it into my rails project and using the asset pipeline. There was some bulk find/replace I had to do to get it happy with image URLs. Here is the overall approach I used:

    1. Put all of the supplied “image” files and directories under
      /vendor/assets/images.
    2. Put all of the supplied stylesheets under
      /vendor/assets/stylesheets
    3. Put all of the supplied javascript under
      /vendor/assets/javascripts

    With the above approach, all relative paths should be maintained as the theme vendor wanted them. For instance, my theme vendor had all images under an ‘img’ directory, so I simply copied that directory so it was /vendor/assets/images/img/…

    Now, we need to get our application.css and application.js files to properly pull in the files it needs:

    1. in /app/assets/javascripts/application.js add require lines to add all of the javascript that your theme vendor says you need
    2. in /app/assets/stylesheets/application.css add require lines to add all of the stylesheets needed

    Now the tricky part depends on whether or not your javascripts and stylesheets included other items. For any files that did, I recommend you rename them to .erb (add a .erb to the filename) which allows you to use the rails helpers such as asset_path and image_path:

    .i24_arrow-180{ background-image: url(<%= asset_path 'img/icons/packs/fugue/24x24/arrow-180.png' %>); }
    

    Or, in your javascript:

    '<%= asset_path('js/mylibs/charts/jquery.flot.orderBars') %>':
    

    Once you’ve fixed any image paths you should be ready to go with the new theme, and it will work with the Asset pipeline!

    Warning: I spent hours debugging an asset compilation problem with a theme and it turned out it was because one of the images had a parenthesis in the filename and the sass compiler was gagging on that!

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

Sidebar

Related Questions

Let's say I have the simple rails blog app. And I have a custom
I have rails app with mongoid model. There's counter field in this model which
I'm running a Rails 3.0.7 app with nginx and Passenger. I have a custom
I have a custom accessor method in my rails 3.1.6 app that assigns a
I have a Rails app that uses a lot of custom statistics code I
In a stats part of a Rails app, I have some custom SQL calls
I have created a custom theme for my activities that they all use. In
I have an activity that appears as a dialog using the following custom theme:
I have an existing website that works with my custom theme. Unfortunately, it does
I currently have a web site where users can select a custom theme. After

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.