Hi Monks,
I have a question regarding basic Catalyst dispatching. Lets say I have a public url like this:
/app/reporting/42
Which displays reports about the account with account_id 42. I tried this:
package MyApp::Controller::App::Reporting; use Moose; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller'; } sub reporting :Chained('chained_index') PathPart('reporting') Args(1) +{ my( $self, $c, $account_id ) = @_; $c->log->debug( "Generating report for account $account_if" ); }
But when I fire up my Catalyst servers I see this:
[debug] Unattached Chained actions: .-------------------------------------+------------------------------- +-------. | Private | Missing parent + | +-------------------------------------+------------------------------- +-------+ | /app/reporting/reporting | /app/reporting/chained_index + | '-------------------------------------+------------------------------- +-------'
My question is how do I go about creating a method that will handle requests to urls of the form /app/reporting/id, In general I am trying to wrap my head around Catlayst controllers, in particular, how to structure controller for paths. Eventually (next week) I'll need to do create controllers to handle requests like:
/app/reporting/42/product_group/foo/product/bar
that will need to report on account id 42, product group id 'foo' and product id 'bar'. How would I do this? Thanks in advance for the help monks. Any help in the right direction would be awesome. I'm reading the docs but still not getting it.

In reply to Newbie Catalyst dispatch question by mobiusinversion

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.