add 'to' action to controller, add test (currently failing, show error)
[catagits/catbook-code.git] / lib / LolCatalyst / Lite / Controller / Translate.pm
index 04d6a96..749b3ac 100644 (file)
@@ -34,4 +34,13 @@ sub view :Chained('object') :PathPart('') :Args(0) {
   );
 }
 
+sub translate_to :Chained('object') :PathPart('to') :Args(1) {
+  my ($self, $c, $to) = @_;
+  my $object = $c->stash->{object};
+  $c->stash(
+    result => $object->translated_to($to)
+  );
+  $c->stash(template => 'translate/view.tt');
+}
+
 1;