Skip to content

Commit

Permalink
documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 14, 2013
1 parent a8d9124 commit b94dd50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Routes/Match.pm
Expand Up @@ -18,7 +18,7 @@ sub path_for {
# Find endpoint
else { return $name unless $endpoint = $self->root->lookup($name) }

# Merge values
# Merge values (clear format)
my $captures = $self->stack->[-1] || {};
%values = (%$captures, format => undef, %values);
my $pattern = $endpoint->pattern;
Expand Down
15 changes: 3 additions & 12 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -155,10 +155,9 @@ sub to {
return $pattern->defaults unless @_;
my ($shortcut, %defaults) = _defaults(@_);

# Shortcut
if ($shortcut) {

# App
# Application
if (ref $shortcut || $shortcut =~ /^[\w:]+$/) {
$defaults{app} = $shortcut;
}
Expand All @@ -170,8 +169,7 @@ sub to {
}
}

# Merge defaults
$pattern->defaults({%{$pattern->defaults}, %defaults}) if %defaults;
$pattern->defaults({%{$pattern->defaults}, %defaults});

return $self;
}
Expand Down Expand Up @@ -363,19 +361,12 @@ L<Mojolicious::Lite> tutorial for more argument variations.
=head2 detour
$r = $r->detour(action => 'foo');
$r = $r->detour({action => 'foo'});
$r = $r->detour('controller#action');
$r = $r->detour('controller#action', foo => 'bar');
$r = $r->detour('controller#action', {foo => 'bar'});
$r = $r->detour(Mojolicious->new);
$r = $r->detour(Mojolicious->new, foo => 'bar');
$r = $r->detour(Mojolicious->new, {foo => 'bar'});
$r = $r->detour('MyApp');
$r = $r->detour('MyApp', foo => 'bar');
$r = $r->detour('MyApp', {foo => 'bar'});
Set default parameters for this route and allow partial matching to simplify
application embedding.
application embedding, takes the same arguments as C<to>.
=head2 find
Expand Down

0 comments on commit b94dd50

Please sign in to comment.