2010/5/4 Sergio Cambra .:: entreCables S.L. ::. <[email protected]>:

> I think you don't need to set primary_key neither foreign_key options. And you
> have to use client column:
> config.columns = [:cli, :client]
> config.columns[:client].form_ui = :select

Yes, I already fixed it as I explained in a new mail for this thread :)


>> > Also,
>> > code from above won't work in production mode, it will load the clients
>> > in startup time and new clients won't appear in select box until
>> > application is restarted.
>>
>> Well, it will work as I compute the hash (Client.all.map....) each
>> time, which of course is very inneficient so I'd really like to
>> improve it by making your suggestion to work, but I can't do it as
>> shown above, no idea what is wrong :(
>
> Are you sure? When app is started, class is loaded, while class is being
> loaded Client.array is called and saved in ActiveScaffold config, which is
> stored in a class variable. In each request, column is rendered using options
> saved in a class variable, and new clients are not in that variable. It works
> in development mode because classes are reloaded for each request.

Yes, but Client.array is not an array but a class method which does
"Client.find.all..." stuff and returns an array.
Anyhow I've droped this design and now I use "form_ui = :select" which
does the job really better :)


Thanks.


>>
>>
>> Really thanks a lot for all your useful help.
>>
>> --
>> Iñaki Baz Castillo
>> <[email protected]>
>
> --
> Sergio Cambra .:: entreCables S.L. ::.
> Mariana Pineda 23, 50.018 Zaragoza
> T) 902 021 404 F) 976 52 98 07 E) [email protected]
>
> --
> 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.
>
>



-- 
Iñaki Baz Castillo
<[email protected]>

-- 
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