【问题标题】:How do I override a redirect_to in Rails/RefineryCMS/Devise?如何在 Rails/RefineryCMS/Devise 中覆盖 redirect_to?
【发布时间】:2014-05-25 21:06:05
【问题描述】:

我正在尝试覆盖此方法和此重定向:

https://github.com/refinery/refinerycms/blob/master/authentication/app/controllers/refinery/passwords_controller.rb#L39

我有这个:

Refinery::PasswordsController.class_eval do
  layout 'layouts/application'
  after_filter :redirect_to_our_login, only: :create

  def redirect_to_our_login
    redirect_to main_app.sign_in_community_members_path
  end

当然,它给了我AbstractController::DoubleRenderError。如何取消第一个 redirect_to 并使用我自己的 redirect_to 路径?

【问题讨论】:

    标签: ruby-on-rails devise refinerycms


    【解决方案1】:

    我最终只是复制了整个方法并更改了那一行(并向类添加了完全限定的名称)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 2014-10-03
      • 1970-01-01
      • 1970-01-01
      • 2014-03-30
      • 1970-01-01
      相关资源
      最近更新 更多