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

425
Views
Ruby on Rails 7 - Is there any way to implement js.erb files?

I've looked around for a couple days now for a way to implement js.erb files into my Ruby On Rails 7 application and could not find any resources on this topic. Are js.erb files completely depreciated in Rails 7? If so, is there any way to call in partials in the javascript files of import map?

I'm trying to implement a javascript function that re renders and updates the "like" count on a post. My approach requires me to pull the count data from a table and change the element's text with that ruby partial.

Any resources or a point in the right direction would be greatly appreciated!

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

0

Not really.

With RoR 7, Javascript is handled using these ways:

  • Webpack
  • Import Map
  • ESBuild
  • Rollup

Regardless the handling technology used, the Javascript code is packaged during the development/deployment process. It can not be updated at runtime.

However, the need you expressed is easy to address. Use Hotwire, the new technology introduced few months ago and now part of Rails 7. Simply speaking, Hotwire stands for HTML over the wire. What it does is to send a partial over the wire in real time. Check on YouTube and you'll find plenty of tutorials explaining how to use Hotwire with Stimulus, React or Vue.

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!