Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
What is "//= require" in a JavaScript file in a Rails app?

I'm looking at the source code of a Ruby on Rails app. Several of the JavaScript (*.js and *.es6) files in the source have one or more lines at the top of the file like:

//= require path/to/some_other_js_file

What are these lines called, and what are they doing?

(Potentially helpful SEO for folks who may be searching for a question like this, as I myself did prior to asking: slash slash equals require; double slash equals require)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

These are "Sprockets directives," part of the Rails Asset Pipeline, part of how Rails performs combining and fingerprinting of JavaScript and CSS assets.

See https://guides.rubyonrails.org/asset_pipeline.html, in particular section 2.4 Manifest Files and Directives.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!