Skip to content

Commit

Permalink
add a note
Browse files Browse the repository at this point in the history
  • Loading branch information
fcuny committed Aug 22, 2010
1 parent 8617496 commit 7a8d47c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Dancer/Route/Registry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ sub add_route {
my @registered = @{$self->{routes}{$route->method}};
my $last = $registered[-1];
$route->set_previous($last) if defined $last;

# if the route have options, we store the route at the begining
# of the routes. This way, we can have the following routes:
# get '/' => sub {} and ajax '/' => sub {}
# and the user won't have to declare the ajax route before the get
if (keys %{$route->{options}}) {
unshift @{$self->{routes}{$route->method}}, $route;
}
Expand Down

0 comments on commit 7a8d47c

Please sign in to comment.