Ruby Building Web Apps with Sinatra ERB Templates URL Parameters

Clinton Wessinger
Clinton Wessinger
4,476 Points

How can I combine the Hello string with the interpolated name in the response? Is this not valid?

I'm missing something incredibly obvious here I know it. Any pointers?

hello.rb
require "sinatra"

get "/greet/:name" do
    puts "Hello #{params[:name]}
end
Clinton Wessinger
Clinton Wessinger
4,476 Points

Here was the question - "In the get route for the "/greet/:name" path, respond with a string reading "Hello" followed by the contents of the name URL parameter."

1 Answer

Tyler Maxwell
Tyler Maxwell
32,166 Points

He Clinton, double check your syntax in the puts statement. You're making a simple mistake that I've made a thousand times! Good luck and happy coding!