Skip to content

Commit

Permalink
better route name example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 30, 2011
1 parent 4fafe3a commit e506a48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -220,16 +220,19 @@ Nameless routes get an automatically generated one assigned that is simply
equal to the route itself without non-word characters.
# /
get '/' => 'index';
get '/' => sub {
my $self = shift;
$self->render(name => 'Reload');
} => 'index';
# /hello
get '/hello';
__DATA__
@@ index.html.ep
<%= link_to $name => 'index' %>.
<%= link_to Hello => 'hello' %>.
<%= link_to Reload => 'index' %>.
@@ hello.html.ep
Hello World!
Expand Down

0 comments on commit e506a48

Please sign in to comment.