[jifty-devel] Getting name instead of ID (in refers_to column)

Alex Vandiver alexmv at bestpractical.com
Wed Mar 7 01:04:26 EST 2007


On Tue, 2007-03-06 at 22:01 +0000, mraptor wrote:
> I was wondering is there an easy way to display in a FORM instead 
> of the ID the Name from the fk table.
> The best (or should I say absurd) thing I came to is this :
> 
> My::Model::Client->new->load( $action->form_field($name)->current_value )->column('client_name')
> 
> still getting this error :
> 
> Can't locate object method "column" via package "Fetched from
> cache" (perhaps you forgot to load "Fetched from cache"?) 

The action, if it is a descendant of Jifty::Action::Record, has a
->record method.  Try:

$action->record->client_name
 - Alex




More information about the jifty-devel mailing list