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