luislavena/radix

Trailing slash for kemal routing

waghanza opened this issue · 2 comments

Hi,

I have open an issue kemalcr/kemal#113 on kemal.

The problem is that radix done right when I have 1 an 1 only URL param

/paypload

but no when I have more than 1 URL param

/payload/game

I have a trailing slash for the first URL param.

Code example:

require "radix"

tree = Radix::Tree.new
tree.add "/:controller/:action", :my_route

result = tree.find "/products/featured"

if result.found?
  pp result.params # => result.params = {"controller/" => "products", "action" => "featured"}
end

Regards,

Thank you @waghanza, I've updated the issue to show a piece of code that presents the issue being reported.

Will take a look soon.

Cheers.

Solved by #3.

Cheers.