mojolicious / mojo

:sparkles: Mojolicious - Perl real-time web framework

Home Page:https://mojolicious.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

url_to with params not rendering params

janlimpens opened this issue · comments

commented
  • Mojolicious version: 9.26
  • Perl version: 5.36
  • Operating system: Debian bullseye

I have a mojolicious lite app and in it, I have this route:
get 'some_route/<page:num>' => sub($c) { ... };

In the template, I try to call it like this:

%= url_for('some_route', {page => 1});
# or
%= url_for('some_route', page => 1);

Which renders
some_route

and I think, it should render
some_route/1

Am I misunderstanding anything here? I am following
https://docs.mojolicious.org/Mojolicious/Controller#url_for
and
https://docs.mojolicious.org/Mojolicious/Guides/Routing#Optional-placeholders