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 Adding New Data Route Priority

Steve Torrens
Steve Torrens
3,826 Points

Changed the route definition order but not getting a correct answer

Hi,

For the fish.rb question I changed the route definition order, with the /random/fish route ahead of the /:humber/fish route. I tested the code on my machine and it looks like it works. Does this question have a bug?

fish.rb
require "sinatra"

get "/random/fish" do
  "I see #{rand(20)} fish!"
end

get "/:number/fish" do
  "I see #{params[:number]} fish!"
end

1 Answer

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

There was an error with this challenge that we just fixed. Try again now. Your code should pass as-is. Sorry for the trouble!

Steve Torrens
Steve Torrens
3,826 Points

Thanks Jay!! All working now. FYI : I am enjoying the ruby course. Cheers, Steve