Rails caches_action 的用法问题

z2323721 · June 15, 2013 · 2615 hits

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 应该肿么写呢?

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.