Jump to content

The ultimate community for Ruby on Rails developers.


Habtm - Mutiple records in one form

habtm relationship

  • Please log in to reply
No replies to this topic

#1 raphaelt



  • Members
  • 7 posts

Posted 22 July 2014 - 11:07 AM

Hello guys,
I'm unable to resolve an issue, hope you guys can help me.

-> Member
-> Meeting

The relationship of these two is habtm by join table meetings_members
Every meeting the members can score points, so the table of meetings is like this:

Meetings Table
-> score (integer)
-> date (date)
-> attendance (boolean)

Now, my issue. I would like to register the members points, but when I click on register points i have a input (date) to choose the meeting date and then a list of all members names with a input on the side (score) and a checkbox to attendance of each member. At the end, a button to save all records.
Like this:

| Meeting date: (datepicker)
| Members:
| Member 1 | score input | attendance checkbox
| Member 2 | score input | attendance checkbox
| Member 3 | score input | attendance checkbox
| Member 4 | score input | attendance checkbox
| Member 5 | score input | attendance checkbox

Save All

When I save, a meeting on the date selected is automatically created with the score and attendance of each member.


I also would like to have a list of the meetings and when I enter in one meeting i can see all points and attendances of each member on that specific meeting. 

Also tagged with one or more of these keywords: habtm, relationship

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users