Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Catalyst DBIx Help

by Solo (Deacon)
on Aug 25, 2011 at 08:40 UTC ( #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 ] ); }


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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2022-05-16 09:07 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (62 votes). Check out past polls.