Rails 页面跳转错误 求解 急!!!!!

suyuhang · 2014年05月15日 · 最后由 suyuhang 回复于 2014年05月15日 · 1645 次阅读

在 controller 中

1.我用这句话就没错

@suggestions = Suggestion.group("content").order("count(*) desc").page(@page).per(@count)

2.而这句话就有问题

Suggestion.select("content,user_id,count(*) as count).group("content").order("count desc")

报错是 No route matches {:action=>"show", :controller=>"suggestions", :id=>#}

第一句加 controller 就没问题 可是第二句就有问题

第二句里面没有 id, rails 生成不了 url

#1 楼 @rociiu 那我应该怎么修改啊

#1 楼 @rociiu 我懂了 谢谢你 我弄好了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号