4 ms·
JS in rails is entirely opt-in.
by sosborn 6y ago
JS in rails is entirely opt-in.
- WJW 6y agoOpt-in means the default is without JS and you can enable it if you want. As shown in the gist, the situation is actually that by default all the JS is installed and you have to explicitly opt-out to prevent it from being installed.
- sosborn 6y agoWhen you create a new rails project, the tooling for JS is set up, but none of that gets used (Turbolinks the only exception) unless you write or include JS code. The tooling does not affect the user experience one bit.
- cocktailpeanuts 6y agoNo. That's what it used to be in the old days, but not anymore. I've been away from rails for a couple of years and recently came back to build a side project. The latest rails version shoves all kinds of JS stuff down your throat, you have to literally opt out. The whole point of rails is "convention over configuration", and they have adopted the bloated NPM + Webpack ecosystem as their "convention".