Hello all,
I'd like to render some HTML content being formatted from a TT view via AJAX.
Can anybody recommend a way to do that please?
The method I am using now for AJAX is REST controller and JSON View.
...
sub ajaxaction :Local :ActionClass('REST') {}
sub ajaxaction _GET {
my ($self, $c) = @_;
my $rs = $c->model(DN)->resultset(Table)->find(...);
my $body =
$c->view(MYTT)->render($c,'dir/temp.mailtt',$c->stash( result => [ $rs ] )); ß
this is the weird bit I guess.
my @content =();
push @content, $body;
$self->status_ok(
$c,
entity => \@content,
);
}
sub end :Private {
my ($self, $c) = @_;
$c->forward("View::JSON");
}
..but doing this I get the error:
Caught exception in MyApp::View::JSON->process "encountered object
'MyApp::Model::DB::Table=HASH(0xdb2c330)', but neither allow_blessed nor
convert_blessed settings are enabled at (eval 1606) line 151."
Thanks for your help.
Roland
Aptina (UK) Limited, Century Court, Millennium Way, Bracknell, Berkshire, RG12
2XT. Registered in England No. 06570543.
This e-mail and any attachments contain confidential information and are solely
for the review and use of the intended recipient. If you have received this
e-mail in error, please notify the sender and destroy this e-mail and any
copies.
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/