Rails caches_action 的用法问题

z2323721 · 2013年06月15日 · 2614 次阅读

caches_action :new, layout: false def new @session = Session.new store_location request.referrer if request.referrer.present? end

我的代码是这样写的,但是 Production 中回返回 404 页面。 报错是:

ActionController::RoutingError (No route matches {:format=>nil, :controller=>"sessions", :action=>"new"}):

没有 caches_action 的时候,页面是可以正常访问的。

6.16

这个是我找到的比较像的一个 https://github.com/raul/translate_routes/issues/22 但是他说 加了一句 ActionDispatch::Routing::Translator.translate_from_file('config','i18n-routes.yml') 这个是应该 2.0,3.0 应该肿么写呢?

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