0
的帖子我得到一個錯誤,它認爲我的動作是發帖ID?ROR新的動作錯誤找不到ID = nexttwentyfive
URL http://localhost:3000/posts/nexttwentyfive?lastid=1
def nexttwentyfive
@posts = Post.find(:all, :order => "date", :limit => 25, :conditions => ["id=? AND created_at > ?", Time.now, params[:lastid]])
respond_to do |format|
format.html
format.xml { render :xml => @post }
format.json { render :json => @post }
end
end
map.resources :posts, :collection => { :nexttwentyfive => :get }
你重新啓動服務器?什麼'耙路線| grep「下一個」輸出? – macarthy 2011-03-05 00:12:26
@nathanvda'map.resources'是Rails2路由語法。 – 2011-03-05 00:32:50