Have you tried to decalre the display field?

if you add the line

var $displayField = 'name';

in the artists model class it should show the name instead of the id field.

Hope that helps!


On Wed, Jul 14, 2010 at 4:15 AM, Jramirez07 <[email protected]> wrote:

> Hello,
>
> I am very new to cake and started using to test things out and so far
> loving it. Have had some complications and been searching everywhere
> for answers on it but no luck.
>
> Here's what I have:
>
> two models: Artists & Albums which are associated with each other with
> the hasMany / hasOne respectively.
> Both model Controllers have the standard CRUD with some minor
> modifications which i'll explain below.
> Database is a follows:
>
> //Artist DB
> artists.id_artists
> artists.name
>
> //Album DB
> albums.id_albums
> albums.id_artists
> name
> year
>
> Problem is in the view of my Album: I can successfully add new Albums
> with the standard 'add' that bake generates for me (with some
> modification for selecting the Artist in a Select Drop Down Box
> instead of an input box for the id) but when I go back to the index
> (the list Albums), I'm getting the album.id_artist (along side
> album.name and album.year)
>
> How can I change the album.id_artist  to reflect  artists.name  as I
> do not want my users to see the id of the artist.
>
> Please heeelp!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to