Update a view
Open the app/views/welcome/index.html.erb file.
Apart from the existing static text within the
h1tag, the view file contains:
tagthat adds a button with a specific identifier.
Specify the file name (hello in our case) and press Enter.
In this script we've:
hellofunction that writes a message to the web console and displays an alert dialog with this message.
Appended an event listener to our web page to invoke the
hellofunction when a user clicks a button.
Start a web server
To see our application in action, you need to start a web server.
Press Ctrl twice and start typing development.
Select the Development run configuration from the list and press Enter.
RubyMine will show the process of preparing the application to run.
Copy the http://0.0.0.0:3000/welcome/index address used by a web server, insert it to the browser's address bar, and press Enter to see the welcome/index page. Then, click the Hello! button to see the alert.