All threads / Is 'js.erb' approach obsolete? What are the alternatives?

Ask A Question


You’re not receiving notifications from this thread.

Is 'js.erb' approach obsolete? What are the alternatives?

dk asked in Rails

Just like in the title, is using js.erb a bad practice? What are the best alternatives to manipulate the DOM?
I am trying to understand when to use each approach correctly, like stimulus or turbo streams etc.

I don't believe you'll be able to use .js.erb responses in Turbo going forward. They're pretty much replaced by TurboStreams. 👍

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 54,645+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.