Permalink
Browse files

better route name example

  • Loading branch information...
kraih committed Nov 30, 2011
1 parent 4fafe3a commit e506a48fd6fe787a14e4f21ce994450e3993bdc0
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/Mojolicious/Lite.pm
View
@@ -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!

0 comments on commit e506a48

Please sign in to comment.