Skip to content

Commit

Permalink
documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 25, 2013
1 parent c325cb4 commit 13e8ae1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -908,6 +908,10 @@ to inherit query parameters from the current request.
Get L<Mojolicious::Validator::Validation> object for current request. Note
that this method is EXPERIMENTAL and might change without warning!
my $validation = $c->validation;
$validation->required('title')->size(3, 50);
$validation->optional('description')->size(1, 250);
=head2 write
$c = $c->write;
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -253,7 +253,7 @@ request.
=head2 validation
%= validation
%= validation->errors('description')
Alias for L<Mojolicious::Controller/"validation">. Note that this helper is
EXPERIMENTAL and might change without warning!
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Validator.pm
Expand Up @@ -6,8 +6,8 @@ use Mojolicious::Validator::Validation;
has checks => sub { {size => \&_size} };
has errors => sub {
{
size => sub {qq{Value needs to be $_[3]-$_[4] characters long.}},
required => sub {qq{Value is required.}}
required => sub {qq{Value is required.}},
size => sub {qq{Value needs to be $_[3]-$_[4] characters long.}}
};
};

Expand Down

0 comments on commit 13e8ae1

Please sign in to comment.