class

Array

v4.1.8 - Show latest stable - Superclass: Object

No documentation available for this class.

Files

  • activesupport/lib/active_support/core_ext/array/access.rb
  • activesupport/lib/active_support/core_ext/array/conversions.rb
  • activesupport/lib/active_support/core_ext/array/extract_options.rb
  • activesupport/lib/active_support/core_ext/array/grouping.rb
  • activesupport/lib/active_support/core_ext/array/prepend_and_append.rb
  • activesupport/lib/active_support/core_ext/array/wrap.rb
  • activesupport/lib/active_support/core_ext/object/blank.rb
  • activesupport/lib/active_support/core_ext/object/deep_dup.rb
  • activesupport/lib/active_support/core_ext/object/json.rb
  • activesupport/lib/active_support/core_ext/object/to_query.rb

1Note

sort_by

Ramon ยท Oct 3, 2009

array.sort_by {|element| [element.foo, element.bar.name, element.baz]}

Taken from http://redcorundum.blogspot.com/2006/10/using-sortby-instead-of-sort.html