I'm so shamed! Why am I so dumb! Sorry.

I had found stackoverflow's answer from gdey:

What JSON view are you using? It seems that it is converting everything in the stash (This is the default.) The JSON view needs to be configured to only convert things in json_data field of the stash. in your 'MyApp.pm' add something like: MyApp->config({ 'View::JSON' => { expose_stash => 'json_data' } }); replacing MyApp with the name of your application controller.

But I was using the config in a inner controller while should be using in application controller.

My first post, my first self humiliation (and almost 5 years late).


In reply to Re^2: correct way to Catalyst::View::JSON? by cragapito
in thread correct way to Catalyst::View::JSON? by xiaoyafeng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.