堆栈级别太深ActionMailer

时间:2013-05-07 18:36:38

标签: ruby-on-rails ruby-on-rails-3 actionmailer

真正的堆栈溢出......这是我第一次从应用程序发送电子邮件。

从表格中:

<%= form_tag request_path do %>
  <%= text_field_tag :email, nil, placeholder: 'Find...', class: 'ui-corner-all' %>
  <%= submit_tag "Send request", class: 'button' %>
<% end %>

到控制器:

def request
  user_email = params[:email]
  UserMailer.request(user_email).deliver
  #flash[:notice] = "We'll let #{@user[:name]} know!"
end

通过邮件:

def request(email)
  @url = "http://mysite.herokuapp.com/"

  mail to:          email,
       subject:     "#{first_name(current_user)} would like to say hi!"
end

我在我的控制台中得到了这个:

SystemStackError (stack level too deep):
  actionpack (3.2.12) lib/action_dispatch/middleware/reloader.rb:70

  Rendered C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
  Rendered C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
  Rendered C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (31.2ms)

谷歌让我失望了,所以希望有人在这里有一个线索。

2 个答案:

答案 0 :(得分:0)

你在项目中使用delayed_job吗?

几天前我和delayed_job有类似的问题。 This当时帮助了我。

答案 1 :(得分:0)

request是Rails中的关键字。这是一个很大的不,不。我在所有位置将其更改为request_pal,一切都很顺利。