Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

432
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda