Re: Re: HABTM Duplicates?


#1

Not too much going on in the code (I don’t think). Several select boxes
in
the character view, which look somewhat like this:

<% regular_skills =
SkillCategory.find(:first, :conditions => “name = ‘Regular’”).skills %>

<%= 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).

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

Matt

— 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
a
count attribute in the join model. Then you wouldn’t need to worry about

counting multiple rows in the join table.


Josh S.

http://blog.hasmanythrough.com


Posted via http://www.ruby-forum.com/.


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails