Dear Rodrigo
I tired your tip, but my response is:
{"json":[{"value":"Paddyfield Warbler","label":"Paddyfield
Warbler","id":"Acrocephalus agricola"}]}
and -of course- there is no any suggest. :(
I thought that Catalyst::View::JSON translate perl datastructures to
corresponding JSON data structure ( hash > object ... as i see on
http://www.json.org) automatically. ( if not, i could use manually
created JSON formatted string without any JSON module)
Thank You!
Have you tried this?
sub request : Local {
my ($self,$c) = @_;
$c->stash->{json} = [ { id=>"Acrocephalus agricola", label=>
"Paddyfield Warbler", value=> "Paddyfield Warbler" } ];
$c->forward('View::JSON');
}
It gives me back the following response:
$ curl http://localhost:3000/request <http://localhost:3000/test>
[{"value":"Paddyfield Warbler","id":"Acrocephalus
agricola","label":"Paddyfield Warbler"}]
Which works with JQuery's autocomplete example just fine
-rodrigo
------------------------------------------------------------------------
_______________________________________________
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/
_______________________________________________
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/