#91 ✓resolved
Ryan Tyler

order_by_link

Reported by Ryan Tyler | June 12th, 2009 @ 10:39 AM

Hi,

I have a column which returns a list of "Faculty" IDs, I have a helper which does a look up and replaces these ID's with the faculty description in a different table. So in the column I see the Faculty name i.e FAT, but when I sort its sorting on the ID:

The table header:

The column data:

What I would like to know is how to sort on the text in the column and not the ID.

Thanks

<%= remote_order_by_link :facultycode_id, :text => 'Faculty' %> <%=h Get_faculty_code(course.facultycode_id) %>

Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson June 20th, 2009 @ 04:56 AM

    • State changed from “new” to “resolved”

    You need to pass the name of the relevant column in the database that contains the text. Passing the id will order the results by the id.

    Also, check out searchlogic v2, it might be better with some edge cases where you need weird searching, etc.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket

Pages