Ruby on Rails Thursday, October 9, 2014

Let's say I have

group
has_many :memberships
has_many :members, :through => memberships

and vice versa, and there's a model called memberships that stores extra
information, such as the reason for joining, etc.

How do I then actually USE this in my models, controllers and views?

Do I need to create new memberships using a form?

Can I for instance, on a group's show view that displays an individual
group, have a form at the bottom that allows the CURRENT USER to JOIN
the group and provide a reason for joining by sending a put request form
to the memberships controller?
How would I access the memberships form if I'm on the group's page?

Thank you for your help and patience.

--
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 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/1f778c88617c62b3c1bf46eb3b0e25b5%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment