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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:05:12+00:00 2026-06-10T00:05:12+00:00

I’m trying to build an administration backend Rails engine. Suppose the Engine has the

  • 0

I’m trying to build an “administration backend” Rails engine. Suppose the Engine has the following assets:

ENGINE/app/assets
├── javascripts
│   └── railsyard
│       ├── admin.js.coffee
│       ├── admin_customizations.js.coffee
...

Where the admin.js.coffee is requiring admin_customizations.js.coffee, that is, an empty file ready to be overwritten by the hosting Rails application.

[ENGINE/app/assets/javascripts/my_engine/admin.js.coffee]
#= require admin_customizations
# ...some code...

[ENGINE/app/assets/javascripts/my_engine/admin_customizations.js.coffee]
# Override this empty file to add custom JS behaviour!

Everything works wonderfully, until I try to require some assets coming from a secondary gem:

[APP/app/assets/javascripts/my_engine/admin_customizations.js.coffee]
#= require modernizr # this line gets ignored
alert "Foobar"       # this line works

The gem modernizr-rails is a dependency of the hosting app rather then the engine.
Please note that if I try to require modernizr from an asset file that’s not an override of some engine asset file, everything works again.

Is there a way to fix this situation?

  • 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-10T00:05:14+00:00Added an answer on June 10, 2026 at 12:05 am

    I believe I have done exactly what you describe without having the problem you say you have.

    You sure there’s not something else going on? The require line getting ignored doesn’t make much sense — sprockets should either include the required file, or raise if it can’t find it. Just silently doing nothing doesn’t seem right.

    It’s possible you’re triggering a bug in sprockets or the rails asset pipeline use of it — but more likely, there’s something else going on.

    You sure you haven’t accidentally provided your own blank ‘modernizr.js` file in the local app and/or engine, accidentally overriding the one you mean to be requiring from the modernizr gem?

    sprockets require lines do need to be in comments that preceed any code in file, they have to be in an initial prefatory comment block. could that be getting you?

    or maybe something else that’s not actually what you think it is.

    I don’t actualy use coffeescript myself, something weird with coffeescript somehow?

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And

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.