Forum: Ruby on Rails Sorting with SQL for has_one, belongs_to relationship

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jang Choe (Guest)
on 2006-04-12 23:55
(Received via mailing list)
I've been using this sort helper to have sortable tables.

I've encountered a situation where I need to sort a column that is not
part of a table, but it's related table.

For example, say I have db tables called foos and bars. Foos have
fields called name and title. And bars have fields called note and
foo_id. Foos has_one bar. My HTML table needs to have columns name,
title, and note and need to sort among them.

Is there a way to use sort helper to sort those columns? I've looked
at pure javascript solutions but I couldn't find anything that fully
supports safari.

This topic is locked and can not be replied to.