On Martes, 14 de Septiembre de 2010 10:40:58 Iñaki Baz Castillo escribió: > Hi, I have a table "accounts" with these fields: > > ------------- accounts ------------- > - id > - name > - client_code > ----------------------------------------- > > 'client_code' is mandatory and multiple accounts can share same > 'client_code' value. > > > Then I want to show like a "ClientCode" virtual mode. I say "virtual" > because there is not a table containing unique virtual client codes, I > just have the 'accounts' table. This virtual model should only show > these fields: > > ------------ client_codes ------------ > - client_code > - accounts > -------------------------------------------- > > where 'accounts' would be a reference to all the entries in table > 'accounts' with same 'client_code'. > > > Any tip on how to achieve this? Thanks a lot. > > > -- > Iñaki Baz Castillo > <[email protected]>
Do you need to use ActiveScaffold for that virtual model? What actions do you need? You could add a new model, set table to accounts and in client_codes controller define custom_finder_options to set :select => 'distinct(client_code) as client_code' -- 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.
