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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:50:47+00:00 2026-06-10T06:50:47+00:00

I have a templates directory in my assets folder on my Rails setup which

  • 0

I have a templates directory in my assets folder on my Rails setup which hosts my templated-HTML files. I’ve implemented a partial system where I can load text snippets into each template so long as it has a .erb file attached to it. The partials are prefixed with an underscore, so /assets/templates/_form.html is a partial which is included inside of /assets/templates/edit.html. This works, but there is an issue when I run assets:precompile.

The assets:precompile command will precompile the _form.html files as well (since they’re located inside of the assets/templates folder) and I don’t want this to happen since they can’t be precompiled (since any erb variables are missing and so on).

Is there any way I can inform the rake assets:precompile command to ignore certain files (in this case files that have an underscore infront of them)? Does someone know how to do this? Or can someone point me to the github repository which has the source for the rake assets:precompile command?

  • 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-10T06:50:48+00:00Added an answer on June 10, 2026 at 6:50 am

    In Rails 3.2.8 you can find the source for the rake task definition here.

    What you’re asking has been brought up at least once in Sprockets issues tracker

    • https://github.com/sstephenson/sprockets/pull/86

    joshpeek added a new stub directive in Sprockets 2.2 which looks like a promising solution to ‘ignoring’ certain assets from the pipeline.

    Rails 3.2 doesn’t support a version of Sprockets anywhere near 2.2 and there doesn’t seem to be any intention on doing so before Rails 4 from what I’ve read (though I’d love to be wrong about that). Here’s at least one closed issue (no action taken) requesting an upgrade to 2.2.

    • https://github.com/rails/rails/pull/5984

    For your situation though, it seems to me that you might be using app/assets incorrectly. I can’t offer an alternative solution as I don’t know enough about your setup/usage to say definitively, but as you said, files with .erb in app/assets are going to be processed by Sprockets.

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

Sidebar

Related Questions

I have a templates directory with around 10 *.html files. I made changes to
I currently have all my web based files (.html .css. js) in one directory
I have a heavily nested directory structure that contains Handlebars templates in my /app/assets/templates
I have some templates stored in my pages view directory: Pages/settings/edit_account/ basic_info.html.erb relatives.html.erb contact.html.erb
I have my template folder with all html templates lieing together in the template
I have two templates for my HTML email: one for bigger screens, and one
I have seen a few tutorials on jQuery templates , which as far as
I have a Smarty template located in a directory under templates_dir : templates/some/dir/template.tpl .
I have a directory structure: example.py templates/ __init__.py a.py b.py a.py and b.py have
I have a backbone.js front-end and Rails backend, and all my template files are

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.