On Sábado, 13 de Marzo de 2010 02:02:08 Head777 escribió:
> Hi, i was looking for right here and i have nothing and thats why i
> open this thread.
>
> See, I have two tables "supplier" and "products"
>
> Supplier:
>
> class Supplier < ActiveRecord::Base
>
> has_many :products
>
> end
>
> Products:
> class Products < ActiveRecord::Base
>
> belongs_to :supplier
>
> end
>
> And in my controller products, i have this:
>
> class ProductoController < ApplicationController
>
> active_scaffold :producto do |config|
> config.label = "Products"
>
> config.columns = [:name, :price, :supplier]
> list.sorting = {:nombre => 'ASC'}
> end
>
> end
>
>
> And works great, but i want to select in :supplier choose one field i
> want, because when show me the list show me the field call "web site"
> but i want show the name of supplier in that list and i dont know why?
Define the to_label method in supplier model
--
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.