Sortable objects across multiple models

Is there a way to sort (drag n drop) rows across multiple models?


I have a CMS with the models of:




I would like the user to be able to define the sort order of these items.

Each model has a row called ‘sort’.

I can’t figure out the correct active record usage to query and sort these and then update them.

The closest I can get is using multiple select with union.

			SELECT `my_gallery`.`title`, `my_gallery`.`sort_order`

			FROM my_gallery

			WHERE (`my_gallery`.`user_id` = <img src='' class='bbc_emoticon' alt='8)' />


			SELECT `my_pages`.`title`, `my_pages`.`sort_order`

			FROM my_pages

			WHERE (`my_pages`.`user_id` = <img src='' class='bbc_emoticon' alt='8)' />

			ORDER BY `sort_order` ASC

But this doesn’t really do the job. I lose the information of two which table each row belongs.

I guess a better way to ask this question is how do I do this across multiple models?

How do you sort across multiple models for displaying? and how do update the records?