新手问题 Rails current_page? 为什么不支持 post method

bastengao · 2013年10月29日 · 最后由 langzilai 回复于 2013年11月05日 · 2529 次阅读

使用 current_page? 来做 li 的是否选中,工作正常但除过 post 请求回来的页面 current_page? 就是有问题。

搜索结果后 http://stackoverflow.com/questions/9749807/rails-current-page-fails-when-method-is-post ,看源代码中有这么一行

return false unless request.get? || request.head?

请问大侠为什么过滤掉 post 请求?

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