Ruby on Rails Tuesday, December 3, 2013

Hi there,

i want to use collection_check_boxes (in rails 4) but i am a little bit
stuck... okay, first things first:

i have 2 models:

----------------
class Supervisioncategory < ActiveRecord::Base
has_many :phonenotes
end
----------------

and

----------------
class Phonenote < ActiveRecord::Base
belongs_to :employee
belongs_to :supervisioncategory
belongs_to :trainingcategory
end
----------------

and i want to use collection_check_box for the categories

----------------
<div class="field">
<%= f.label :supervision %><br>
<%= collection_check_boxes :phonenote, :supervision_ids,
@supervisions, :id, :name %>
</div>
----------------

shows all the categories i want, i can check them, i made the
":supervision_ids" accessible. But then...
nothing happend? I think my problem is at the typ of the
":supervision_ids".. integer won't work, string won't work. So... can
someone help me with this Problem?

Regards,

Ronny

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c3dd1d9af2a13ccedd6544f111603dd6%40briefkasten.daishi.de.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment