2011-03-04 47 views
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 } 
+1

你重新啓動服務器?什麼'耙路線| grep「下一個」輸出? – macarthy 2011-03-05 00:12:26

+0

@nathanvda'map.resources'是Rails2路由語法。 – 2011-03-05 00:32:50

回答

0

我會按照@macarthy的建議,並重新啓動服務器/檢查路線。

你得到展示nexttwentyfive路線錯誤不被識別爲收集和它的AS /職位/正在處理:ID