Does anyone knows a good example (with code for controller and view) for an HABTM relation?

Hi have two big tables (cars and pieces). A car can have a lot of pieces, so the usual checkbox example used for HABTM is not a good one. Unless it could be possible to search, paginate, etc the values and the checkboxes.

Thanks in advanced.

I don't have any Rails example code, but I built something like this once using Scriptaculous autocompleter to put authors or books into groups. Type a group name, choose one from the autocompleted list, and if you want to add another association, press a New button to add another group (with its own autocompleter) and away you go. Very Ajax-heavy, but it helped make the page shorter!