I solved this in an application by creating a separate "sort_name"
field that was strictly used for sorting. Never seen or used by the
user at all. We had a "before_save :build_sort_name" method that
handled all sorts of cases. Wouldn't be too hard to add something
similar for your scenario.

def build_sort_name
  sort_name = name.gsub(/^(The )(.*)/, '\2, \1') # change "The Title"
to "Title, The "
  sort_name = "ZZZZZZZZZZZZZZ Other" if name = 'Other' # force 'Other'
to sort after everything else
end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to