瀏覽代碼

Use ActiveRecord style ordering

master
Adrian Short 12 年之前
父節點
當前提交
5355646760
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      app/controllers/feeds_controller.rb

+ 2
- 2
app/controllers/feeds_controller.rb 查看文件

@@ -17,8 +17,8 @@ class FeedsController < ApplicationController
# GET /feeds/1.json
def show
@feed = Feed.find(params[:id])
@posts = @feed.posts.sort(:published.desc).paginate(:page => params[:page], :per_page => 20)
@posts = @feed.posts.order("published desc").paginate(:page => params[:page], :per_page => 20)
respond_to do |format|
format.html # show.html.erb
format.json { render json: @feed }


Loading…
取消
儲存