Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Catalyst DBIx Help

by Solo (Deacon)
on Aug 25, 2011 at 08:40 UTC ( [id://922300]=note: print w/replies, xml ) Need Help??


in reply to Catalyst DBIx Help

The problem is, what if I want to display the results of a different DB?

With the caveat that I'm also new to Catalyst, this is what I used for generic DB access (for serving up JSON in my case).

sub data : Chained CaptureArgs(2) { my ( $self, $c, $model, $object ) = @_; # ... $c->stash( model => $model, object => $object ); } sub list : PathPart Chained('data') { my ( $self, $c ) = @_; my $model = $c->stash->{model}; my $object = $c->stash->{object}; # ... $c->stash( json_data => [ $c->model($model)->resultset($object)->a +ll ] ); }

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://922300]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found