我有Liquor的收藏品(https://github.com/evilmartians/liquor)。我这样用它:
{% for dot in: models.dots do: %}
{% end for%}
我在集合pos_down
中有属性dots
。我怎么订购这个系列?
这样的事情{% for dot in: models.dots.sort_by('pos_down') do: %}
?
答案 0 :(得分:0)
如果您使用AcctiveRecord,请使用{
"_id" : "kSqH7QydFnPFHQmQH",
"timestamp" : ISODate("2015-10-11T11:49:50.241Z"),
"dealId" : "X5zTJ2y675PjmaLMx",
"deal" : "Games",
"price" : [{
"type" : "worth",
"value" : "Bat"
}, {
"type" : "Persons",
"value" : 4
}, {
"type" : "Cost",
"value" : 5
}],
"company" : "Company1"
}
http://guides.rubyonrails.org/active_record_querying.html#ordering