# Design / Pattern / Scaffold for has-and-belongs-to-many?

**URL:** <https://www.ruby-forum.com/t/design-pattern-scaffold-for-has-and-belongs-to-many/55172>\
**Category:** Rails\
**Created:** [March 17, 2006, 4:59pm UTC](https://www.ruby-forum.com/t/design-pattern-scaffold-for-has-and-belongs-to-many/55172 "2006-03-17T16:59:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@Duane](https://www.ruby-forum.com/u/Duane)\
**Post date:** [March 17, 2006, 4:59pm UTC](https://www.ruby-forum.com/t/design-pattern-scaffold-for-has-and-belongs-to-many/55172/1 "2006-03-17T16:59:20Z")

</div>

Is there a standard practice for providing a UI into HBTM relationships?  
I have a model User, and a model Training, and I need to manage both  
relationships – show me all the people that have training X, but also  
show me all trainings user U has. And, of course, “Lookup this user and  
then add/remove trainings for this person” or “Lookup this training and  
add/remove users”.

Before I go creating something from scratch I thought I’d check and see  
if there’s a standard way that people have been doing it.

Thanks!

---

<div class="post-metadata">

**Author:** ![Duane](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@Duane](https://www.ruby-forum.com/u/Duane)\
**Post date:** [March 17, 2006, 8:12pm UTC](https://www.ruby-forum.com/t/design-pattern-scaffold-for-has-and-belongs-to-many/55172/2 "2006-03-17T20:12:56Z")

</div>

Hi !

2006/3/17, Duane [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Before I go creating something from scratch I thought I’d check and see  
> if there’s a standard way that people have been doing it.

Take a look at the habtm\_helper plugin - it might just be what you  
want: [https://opensvn.csie.org/traccgi/habtm\_helper\_plugin/trac.cgi/](https://opensvn.csie.org/traccgi/habtm_helper_plugin/trac.cgi/)

Announcement here:  
[http://blog.teksol.info/articles/2005/11/25/habtm-helper-plugin-version-0-2-0](http://blog.teksol.info/articles/2005/11/25/habtm-helper-plugin-version-0-2-0)

Bye !
