Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Building Web Apps with Sinatra ERB Templates Embedding Instance Variables

Let's greet the user, as we did before, but this time using an ERB template. Set up views/hello.erb to output "Hello"

See code for this question- really stuck here

hello.rb
require "sinatra"

get "/greet/:name" do
  @name = params[:name]
end
views/hello.erb
<h1><%=@name%></h1>

1 Answer

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 28,720 Points

Good going, you're pretty close. But read the challenge a little more closely and you will see the hello.erb should also have "Hello" it it -- it doesn't need any special HTML tags.

Hello <%= @name %>