【发布时间】:2015-01-13 09:53:15
【问题描述】:
由于从旧路径重定向到新路径,我添加到了 routes.rb:
Refinery::Core::Engine.routes.prepend do
get 'about.html', to: redirect('/about')
end
mount Refinery::Core::Engine, at: '/'
结果没有重定向到'/about'并引发NoMethodError:
NoMethodError - undefined method `valid_encoding?' for :en:Symbol:
actionpack (4.1.9) lib/action_dispatch/routing/redirection.rb:23:in `block in call'
actionpack (4.1.9) lib/action_dispatch/routing/redirection.rb:23:
req.symbolized_path_parameters.each do |key, value|
unless value.valid_encoding? # <= L23
raise ActionController::BadRequest, "Invalid parameter: #{key} => #{value}"
end
end
当打开'localhost:3000/about.html'时
使用 gems:refinerycms 3.0.0,rails 4.1.9
有解决这个问题的想法吗?
【问题讨论】:
-
你能发布关于页面的控制器代码吗?
-
你为什么打开 /about.html 而不是 /about
-
@Daisuke Terada - 与炼油厂有完全相同的问题并重定向 404。你找到解决办法了吗?