sub process {
my ($class, $r) = @_;
- $r->template( my $method = $r->action );
+ my $method = $r->action;
+ $r->{template} ||= $method; # Authentication may have done this for us
$r->objects([ $class->retrieve(shift @{$r->{args}}) ]);
- $class->$method($r);
+
+ # This allows the authentication mechanism to set the template
+ # without needing to define an action.
+ $class->$method($r) if $class->can($method);
}
sub display_columns {
=cut
-sub column_names { my $class = shift; map { $_ => ucfirst $_ } $class->columns }
+sub column_names { my $class = shift; map {
+ my $col = $_;
+ $col =~ s/_+(\w)?/ \U\1/g;
+ $_ => ucfirst $col } $class->columns }
=head2 description