#72 ✓resolved

Order by Links Default Direction and :select

Reported by Scott | March 24th, 2009 @ 05:13 PM

Is it posible to set the default direction of order_by_links so it would use DESC the first time pressed?

Is it also posible to limit the data returned from a search similiar to :select

@luser.shelves.find(:all, :order => "media asc", :select => 'id, name, media')


Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson March 30th, 2009 @ 11:55 AM

    • State changed from “new” to “resolved”

    Yes in your controller

    @search.order_by ||= :my_field
    @search.order_as ||= :desc

    Also, no you can no limit what fields are returned because of the joins that are required to run your search. If you didnt require any joins I believe the :select option would work just fine.

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