Ruby Building Web Apps with Sinatra ERB Templates URL Parameters

Emily Coltman
PRO
Emily Coltman
Pro Student 9,623 Points

Hello, I'm afraid I don't understand what I've done wrong for this challenge :) Could I have some guidance, please?

Also, for general feedback to Treehouse, it would be really good to have helpful hints on all the challenges - saying "Try again" doesn't tell me what I've done wrong :) Thanks! Emily

hello.rb
require "sinatra"

get "/greet/:name" do
  return "Hello" params[:name]
end

2 Answers

haha, yes I certainly agree about the try again message. You should put: return "Hello #{params[:name]}". Please mark as a best answer if this was helpful.

Emily Coltman
Emily Coltman
Pro Student 9,623 Points

Thanks very much - I've managed to get past this now :) I tried putting "puts" instead of "return" and that didn't work, but when I removed "puts" it did! I can't remember if I ultimately had to use string interpolation to finish successfully.

can you please mark my answer as best answer so others know the question has been resolved