> I'm working growing my app as the doc says. I'm trying to route to a 
> local subroutine: 
>
[...]

> Is this an OK approach? 
>

if you're trying to grow your app, you probably want to use a controller as 
suggested by glen (tempire). what he meant was create a 
Mojolicious::Controller subclass in a separate module, and define trend() 
as a controller method. 

then if you set your new module Foo.pm as the default controller, like this:
my $r = $self->routes->route->to(controller=>'foo');
your original route to #trend will work. 

note that the default location for your template will now be 
templates/foo/trend.[*]

the example app you get via "mojo generate app" does a good job of showing 
how routes, controllers, and templates work together

jay

-- 
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/d/optout.

Reply via email to