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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:20:37+00:00 2026-05-31T12:20:37+00:00

I added a custom engine for HAML in config/initializers. When I visit http://127.0.0.1:3000/assets/page.html it

  • 0

I added a custom engine for HAML in config/initializers.

When I visit http://127.0.0.1:3000/assets/page.html it renders the page successfully.

# page.html.haml

!!! 5
%html{:lang => "en"}
  %head
    = stylesheet_link_tag 'application'
    = javascript_include_tag 'application'

The problem is Rails seems to cache the html asset. When I add or remove a file from the application.js manifest it doesn’t update until I stop the Rails server and run rake tmp:clear. An alternative is to touch the application.js file. I have config.assets.debug = true set because I prefer to see individual files/folders in Chrome DevTools rather than one big application.js file.

Is there a way to exclude certain assets from being cached during development.

Just to reiterate – its the HTML being cached which is the problem, changes to the manifest are reflected when visiting http://127.0.0.1:3000/assets/application.js.

  • 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-31T12:20:38+00:00Added an answer on May 31, 2026 at 12:20 pm

    A brute force solution would be to add some depends_on attributes to the haml file:

    # page.html.haml
    #= depend_on application.js
    #= depend_on application.css
    !!! 5
    %html{:lang => "en"}
      %head
        = stylesheet_link_tag 'application'
        = javascript_include_tag 'application'
    

    This should force the asset to be regenerated when the application.js file is changed.

    There are a few cavets with this. The file names should be the names in the source tree. It assumes you can use # for comments in your HAML renderer (I don’t know HAML so I’m not sure).I’m also not really sure how this works with a custom engine. Also, a better solution would be to have your custom HAML engine track dependencies itself, but I don’t know how to do this.

    See the sprockets docs for more details

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

Sidebar

Related Questions

I added a custom button to my jQuery UI dialog titlebar, as follows: $('#dialog').html(html);
I added a custom section to my app.config file for a Windows Forms Application.
I have added custom field for my Contacts. It consists of: <ContactsSource xmlns:android=http://schemas.android.com/apk/res/android> <ContactsDataKind
I added custom named styles to the app.xaml. I created an external resource dictionary
I have an activity with 2 fragments. I have added custom animations for fragment
I added a custom install action to my installer to add one of my
I added some custom fields (public booleans) to the global class in global.asax.cs which
I added a custom validation method to validate a password. However, it does not
I added some custom products in virtuemart from my custom component and added its
I have added a custom action to the CustomList type. For testing purposes I

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.