24 Aug
2015
24 Aug
'15
9:37 a.m.
On Mon, 2015-08-24 at 12:10 +0300, Gabor Szabo wrote:
I have just tried to set
set serializer => 'JSON';
that caused another issue. Now when I return the main page which is plain HTML, I get an error
Failed to serialize the request: hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this)
Ah yes, the auto-serializer's behaviour used to be that it would auto-detect and act accordingly. That changed in a recent version of Dancer2, full details here: http://advent.perldancer.org/2014/11 In short, you need a separate app, one with a serializer and one without.
Reading the docs you linked to I thought it should just send out the plain HTML page as it is a plain scalar.
Looks like the docs need updating... Andy