class

Array

v3.1.0 - 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/random_access.rb
  • activesupport/lib/active_support/core_ext/array/uniq_by.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/to_param.rb
  • activesupport/lib/active_support/core_ext/object/to_query.rb
  • activesupport/lib/active_support/json/encoding.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