def round(total)
total > 10 && total%10 != 0 ? [total/10*10,"+"].join : total.to_s
end
Showing <%= round(@shops.total_entries) %> shops in Canada.
и, конечно, было бы лучше обернуть его как метод модели
class Shop < ActiveRecord::Base
def self.round
total = count
total > 10 && total%10 != 0 ? [total/10*10,"+"].join : total.to_s
# instead of using `[total/10*10,"+"].join` you can use `(total/10*10).to_s+"+"`
end
end
@shops = Shop.were(:region => "Canada")
Showing <%= @shops.round %> shops in Canada.