Hello,

I'm trying to solve a common task with many to many relationships.

Here are my class definitions:

class User < ActiveRecord::Base
  has_many :questionnaires
  has_many :forms, :through => :questionnaires
end

class Form < ActiveRecord::Base
  has_many :questionnaires
  has_many :users, :through => :questionnaires
end

class Questionnaire < ActiveRecord::Base
  belongs_to :user
  belongs_to :form
end

My problem is to include an extra date field named active_at to User
new/edit form.

When creating a user I need to check forms (via checkboxes) which it
belongs to. I know it can be done by creating checkboxes with name like
'user[form_ids][]'. But I also need to enter a date field for each of
checked relations which will be stored in the questionnaire join model.

Any help is very appreciated
Bodo

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to