Create a to_label method in your model which will return the "value" on
select

2009/8/14 [email protected] <[email protected]>

>
> Hi,
>
> I wonder how I can choose which field in a model is showed in the
> dropdown box when using form_ui = select.
>
> Let me explain with the example below:
>
> I have two models.
>
> account
> has_many :posts
>
> post
> belongs_to accounts
>
>
> In the ActiveScaffold for posts, I added:
>
>  active_scaffold :template do |config|
>    config.columns[:account].form_ui = :select
>  end
>
> If I now look at the page generated by ActiveScaffold, I see a
> dropdownbox populated with: #<Account:0x232ff58> #<Account:0x14456da>
> etc. If I use a column called "name", this will show up. How can I set
> the column to show (e.g. email) in the dropdown box?
>
> Thanks!
>
> Axel
> >
>


-- 
Cordialmente,

Gabriel Sobrinho
Diretor de desenvolvimento

Hite - Comunicação Digital e Mídia Interativa
http://www.hite.com.br/

+55 31 8775 8378

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to