此代码获取 10 条最新记录
@comments = @topic.comment_threads.order("created_at DESC").page(params[:page]).per(10)
我想对获取的记录进行编号。
因为它是 desc 顺序,所以它会是这样的
"Displaying comments 1 - 10 of 18 in total
No. 18 Hi
No. 17 Hello
No. 16 Hola
No. 15 Howdy
No. 14 What's up
No. 13 Hi there
No. 12 Yo
No. 11 Oh
No. 10 Ah
No. 9 Eeeee
我怎样才能在视图中获得这个编号?它应该是这样的
<%= "No. " + ????????????? %>