Hi all,
I have a model that "belongs_to" many other models, many of those
models are just list of names, like country, state, city, profession
... I read about the country_select helper.
Is better to have all those tables or use custom helpers? what the rails way?
Thanks.
For example : http://pastie.caboo.se/104092
# = Schema
# country_id integer
# city_id integer
# state_id integer
# profession_id integer
# category_id integer
# ......
class User < ActiveRecord::Base
belongs_to :country, :city, :state
belongs_to :profession, :category, :subcategory
end
=========== VS
# = Schema
# country :string
# city :string
# state :string
# profession :string
# category :string
# ......
class User < ActiveRecord::Base
end
class ApplicationHelper
def city_select (...)
end
# ....
# ....
end
--
-------------------------------------
Pedro Del Gallego
Email : pedro.delgallego-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---