@ebms = Ebm.all @ebms.sort_by! {|u| u.number}
u.number定义为整数!问题是Rails无法将其与nil进行比较:
comparison of NilClass with 32400 Failed
我该怎么做才能逃避这个错误?
@ebms = Ebm.all @ebms.sort_by! { |u| u.number.to_i }