Also, You should consider fixing your naming to match the Ruby/Rails
naming conventions.
> class Country < ActiveRecord::Base
> has_one :countrydescription
> end
>
> class CountryDescription < ActiveRecord::Base
> belongs_to :country
> end
This reply was almost right, but I think it should be:
has_one :country_description
Class names should be camel case with the first character upper case and
the each word upper.
Example: SomeClassName
Attribute names and method names should be all lower case with
underscores separating each word (consider table column names to be
attributes).
Example: some_attribute_name
ncancelliere wrote:> First - your models should be singularly named. Use Country instead
> of Countries, as your model is of a single country not a group of
> countries.
>
> class Country < ActiveRecord::Base
> has_one :countrydescription
> end
>
> class CountryDescription < ActiveRecord::Base
> belongs_to :country
> end
>
>
> I''d be curious why you''re storing the description of the
country in a
> separate table instead of along with the Country model? Even if
it''s
> meta data I would think this is better kept with the Country model,
> and just have a text field called "description" it''d
keep things
> simpler.
>
> Nicholas
>
>
>
>
> On Aug 20, 4:39�am, Remco Swoany
<rails-mailing-l...-ARtvInVfO7m5VldFQK4jKA@public.gmane.orgt>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---