【问题标题】:AbstractController::ActionNotFound (The action '162e9db178183d33822a3b00b5aed793b1a37971' could not be found for SimpleCaptchaControllerAbstractController::ActionNotFound(找不到 SimpleCaptchaController 的操作“162e9db178183d33822a3b00b5aed793b1a37971”
【发布时间】:2012-02-28 05:06:07
【问题描述】:

您好,我在 Rails3 中使用 Simple captcha 插件。 "人工验证") %>

我在我的视图文件中使用上述代码,但在日志中我收到此错误。

AbstractController::ActionNotFound(找不到 SimpleCaptchaController 的操作“162e9db178183d33822a3b00b5aed793b1a37971”):

任何机构都可以帮助解决这个问题。

在我正在做的路线中

map.simple_captcha '/simple_captcha/:action', :controller => 'simple_captcha'

【问题讨论】:

  • 检查你的 :action 参数,好像是设置了 md5 哈希
  • 我不认为它与 md5 有关。这可能是路由的问题。
  • 我知道,我告诉过你检查你在 :action 参数中设置了什么

标签: ruby-on-rails


【解决方案1】:

您在路由中错过了:action=>"your action name" 添加那个,未知的操作问题将得到解决

map.simple_captcha '/simple_captcha/:action', :controller => 'simple_captcha', :action=> "your action name"

但是,如果您还想发送一些参数以执行操作,请添加它们,例如如果我也想发送“id”,那么路由将是

map.simple_captcha '/simple_captcha/:action/:id', :controller => 'simple_captcha', :action=> "your action name"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-11
    • 2014-08-19
    • 1970-01-01
    • 2015-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多