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 G.
Email : [email protected]