All threads / Which is the simplest way to add ES6 to a Rails 5.1 app?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Which is the simplest way to add ES6 to a Rails 5.1 app?

Francesco Mari asked in Rails

Hi! As of Rails 5.1.4, which is the most simple way to use ES6 in a Rails application?

If you write your Javascript using webpacker, it will use ES6 out of the box.

For the asset pipeline, there's a sprockets-es6 gem.

I've heard about ES6 recently but I'm a little confused.

What is ES6 and what is the benefit of using it in Rails?

It's the next "version" of JS. Thus no specific upside of using it "in Rails". http://es6-features.org

Join the discussion

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

Join 37,344+ 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

    © 2020 GoRails, LLC. All rights reserved.