Indeed after writing my routes I saw the solution
one Cities.pm controller (all other cities have the same methods anyways)
and I'll work with params
/cities/:city_id/:action
Thanks :)
On Saturday, January 25, 2014 12:06:44 AM UTC+2, byterock wrote:
>
> Hmm yes with a but.
>
> You potentially have an endless number of controller .pm
>
> much beter to throw all you cities in one controler with each city a sub
>
> route->("cities/:action/show")->->to("cities#show");
>
> now instead of having to add a new controler for each city you only need a
> new sub of the city name?
>
> the 'show' in the ruout is not really needed IMHO
>
> route->("cities/:action")->->to("cities#show");
>
>
> ------------------------------
> Date: Fri, 24 Jan 2014 11:40:56 -0800
> From: [email protected] <javascript:>
> To: [email protected] <javascript:>
> Subject: [Mojolicious] Re: Help on RESTful routes
>
>
> To answer my own question
>
> for an route like this:
> /cities/:id/neighborhoods/:id/:
>
> All i have to do is to have an controller as city name and then construct
> the route like this
> /cities/:controller/:action
>
> then, when accessing
> /cities/paris/show
> it will pass through Paris.pm controller, action=>show
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]<javascript:>
> .
> Visit this group at http://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.