Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!