Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
sort_by! not working in 1.8.7
2 Posts
sort_by! not working in 1.8.7

sort_by! is not a method of Array nor part of Enumerable. "sort_by" is, and should work and I think you discovered.

b

Person
Forum Rating: 0
Sign In To Rate Post

Hi , In my application i got resultset from db. i have applied shuffle! on my resultset array.

After that i have applied sorty_by!{|c| c[:column_name]} It's giving error

undefined method `sort_by!' for #

resultset array not sorting If am using sort_by instead of sort_by!

My ruby version 1.8.7 Can anybody help me

Person
Forum Rating: 50
Sign In To Rate Post
2 Posts
Login to add your message