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 Practice Sinatra Basics Practice ERB Templates ERB Templates

Ingenious Courses
Ingenious Courses
5,353 Points

This doesn't work or I cannot understand how to use url to get params

I've followed all the necessary steps but still not working.

app.rb
require "sinatra"

get "/:word" do
  @word = params[:word]
  erb :word
end
views/word.erb
<h1><%= @word %></h1>
<p>Backwards: <%= @word.reverse %></p>
<p>Uppercase: <%= @word.upcase %></p>
<p>Length: <%= @word.count %></p>

2 Answers

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

Looks like you're calling a (nonexistent) method named count on @word, when you should be calling length.

Ingenious Courses
Ingenious Courses
5,353 Points

Thanks, Jay and sorry if the question didn't sound quite well! hehe. I've found a few bugs on the platform that I've tried to report threw chat (I didn't get any answer) and thought this could be another one too. The video was not clear enough for me so I'll (re) repeat the session. Tks.

Jay McGavren
Jay McGavren
Treehouse Teacher

Ingenious Courses Sorry to hear you've had some trouble contacting Support! I've notified them and they should be following up with you shortly.

Ingenious Courses
Ingenious Courses
5,353 Points

Thanks Jay! I really appreciated that and wrote an email to them! ;-) Tks again and have a nice day!