Note that there are some explanatory texts on larger screens.

plurals
  1. PORails 3.1RC4 Mailer mail method returns wrong number of arguments (0 for 1)
    primarykey
    data
    text
    <p>I have a pretty standard mailer class with the following method:</p> <pre><code>def request(contact_us) @contact = contact_us mail(:to =&gt; "customercare@our_co.com", :subject =&gt; @contact.subject, :from =&gt; @contact.email) end </code></pre> <p>The error I'm getting is:</p> <pre><code>wrong number of arguments (0 for 1) </code></pre> <p>My first thought that is was the argument being passed in but some debugging/specs confirm the error occurs on the line with mail(:to. The whole trace is below, line 9 is where the method is defined and line 11 is the mail method. I looked through the rails code and this is the method that's actually bailing in ActionView::Base</p> <pre><code>assign_controller(controller) </code></pre> <p>Any thoughts or suggestions? I have also tried RC5 with the same result.</p> <p>Thanks!</p> <p>ArgumentError: wrong number of arguments (0 for 1) from /Users/user/Git/projects/app/mailers/notifier.rb:9:in <code>request' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/action_view/helpers/controller_helper.rb:15:in</code>assign_controller' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/action_view/base.rb:212:in <code>initialize' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/rendering.rb:87:in</code>new' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/rendering.rb:87:in <code>view_context' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/rendering.rb:120:in</code>_render_template' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/rendering.rb:114:in <code>render_to_body' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/rendering.rb:99:in</code>render' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:717:in <code>block in collect_responses_and_parts_order' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:728:in</code>each' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:728:in <code>each_template' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:713:in</code>collect_responses_and_parts_order' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:652:in <code>mail' from /Users/user/Git/projects/app/mailers/notifier.rb:11:in</code>request' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/base.rb:167:in <code>process_action' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/base.rb:121:in</code>process' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionpack-3.1.0.rc4/lib/abstract_controller/rendering.rb:45:in <code>process' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/old_api.rb:65:in</code>process' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:473:in <code>process' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:468:in</code>initialize' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:455:in <code>new' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/actionmailer-3.1.0.rc4/lib/action_mailer/base.rb:455:in</code>method_missing' from (irb):13 from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/railties-3.1.0.rc4/lib/rails/commands/console.rb:45:in <code>start' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/railties-3.1.0.rc4/lib/rails/commands/console.rb:8:in</code>start' from /Users/user/.rvm/gems/ruby-1.9.2-p290@projects/gems/railties-3.1.0.rc4/lib/rails/commands.rb:40:in <code>&lt;top (required)&gt;' from script/rails:6:in</code>require'</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload