I want to sort my entries in a rails application:
@ebms = Ebm.all @ebms.sort_by! {|u| u.number}
u.number defined as an integer! The problem is that Rails cannot compare it to nil :
comparison of NilClass with 32400 failed
What can I do to avoid this error?
sorting ruby ruby-on-rails
John smith
source share