1. Computing
Send to a Friend via Email

Editing Your Application and Start the Server

By

3 of 5

Adding an Action

You can add actions directly to app/app.rb, just as you would have added actions to Sinatra projects. There are a number of commented lines in this file. Take a look at them to see some of the things that can be configured. Go to the bottom of the class and (before the end keyword) add the following method. It's very simple, it'll just return the string "Hello World" when a request is made to the /hello URL. If you're familiar with Sinatra, this will be nothing new to you.

get '/hello' do
  "Hello world"
end

©2014 About.com. All rights reserved.