Forum: Ruby on Rails Re: Re: HABTM Duplicates?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-06-12 20:02
(Received via mailing list)
Not too much going on in the code (I don't think). Several select boxes
the character view, which look somewhat like this:

<% regular_skills =
SkillCategory.find(:first, :conditions => "name = 'Regular'").skills %>

<select id="character_skill_ids" name="character[skill_ids][]">
<%= options_from_collection_for_select(regular_skills,
'id', 'name')

Which is all being saved with the normal create
method in the characters_controller (no extra code there from me).

look into your has_many :through suggestion also. Thanks for looking.


--- removed_email_address@domain.invalid wrote:

> > Is there perhaps an option
to have Rails write duplicates into the
> > table,
> > or am I looking
at the whole model incorrectly? Any advice would be
> > appreciated.

> That should work. Hard to say why it's not without seeing your code. But

> another approach would be to use a has_many :through association with
> count attribute in the join model. Then you wouldn't need to worry about

> counting multiple rows in the join table.
> --
> Josh S.
> --
> Posted via

> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
This topic is locked and can not be replied to.