ruby-on-rails - 设计3.2.4 ,"stack level too deep"

标签 ruby-on-rails devise

当我调用找回密码函数时,我得到:

error info::: SystemStackError in PasswordsController#create stack level too deep

html:
    <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'well form-inline' }) do |f| %>

<span style="font-size:14px;margin-right:10px">email:</span>
<%= f.email_field :email  %>
  <%= f.submit "submit", :class => "btn btn-success", :style => "margin-left:10px" %>
passwords_controller:
def create
self.resource = resource_class.send_reset_password_instructions(params[resource_name])
if successfully_sent?(resource)
  #respond_with({}, :location => after_sending_reset_password_instructions_path_for(resource_name))
  respond_to do |format|
    format.html { redirect_to after_sending_reset_password_instructions_path_for(resource_name) }
    format.json { render :json => {:info=>"aaa" }.to_json }
  end
else
  respond_to do |format|
    format.html { redirect_to new_password_path(resource_name),:notice => "bbb" }
    format.json { render :json => {:errors=>"ccc" }.to_json }
  end
end

最佳答案

我也遇到了同样的问题,我的解决方案如下:

=begin
  require 'devise_resque_mailer'
  config.mailer = 'DeviseResqueMailer'
=end

关于ruby-on-rails - 设计3.2.4 ,"stack level too deep",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24924479/

相关文章:

ruby-on-rails - 设计 after_inactive_sign_up_path_for 不被调用

ruby-on-rails-3 - 如何通过 IP 地址限制对所有设备 Controller 的访问?

ruby-on-rails - Rails 3. Kaminari 显示分页链接但不更改记录

ruby-on-rails - 在 Rails Controller 中过度使用 ".present?"

ruby-on-rails - rspec save_and_open_page 确实创建了一个 html 转储

ruby-on-rails - rails 生成 rspec :install config/environments/development. rb:1:in `<top (required)>': 未定义方法 `configure'

ruby-on-rails - 设计 - 仅由管理员创建用户

ruby-on-rails - Rails 设计 authentication_user 不工作

ruby-on-rails - 不通过授权(设计授权 token )

ruby-on-rails - 设计 sign_in_and_redirect 似乎永远不会工作