Tutorial: Debug JavaScript in a Rails application
RubyMine allow you to debug client-side JavaScript code in a Rails application. In this tutorial, we'll show you how to debug JavaScript in Chrome. We'll use the Rails application created with esbuild in this tutorial.
Enable the JavaScript debugger
To debug JavaScript, enable automatic startup of the JavaScript debugger in the run/debug configuration of your application.
Open the project that you created in this tutorial or create it following the instructions provided there.
Go to and select the automatically created development configuration in the Rails group.
Specify the following options:

Enable the Run browser option and specify http://127.0.0.1:3000. This URL opens the app/views/welcome/index.html.erb view that uses the JavaScript asset.
Enable Start JavaScript debugger automatically when debugging.
Start debugging
To debug the JavaScript code, follow the steps below:
Open app/javascript/hello.js and set a breakpoint on the line that calls
alert.
To start debugging, press Ctrl twice and start typing the name of the Development configuration. Select the configuration, press and hold Shift (the dialog title changes to Debug), and press Enter.
On the opened http://127.0.0.1:3000 page, click Hello!. The debugger pauses at the breakpoint and enables you to examine the application state. To learn more, refer to Debug JavaScript in Chrome.
