title: Ruby on rails. ArgumentError (wrong number of arguments (1 for 5)). Header should match
body: <p>I'm sure this is something stupid but it's kicking my ass. I'm getting ArgumentError (wrong number of arguments (1 for 5)) but the header and the method call match as far as I can see.</p>
  
  <p>Error Page (Photo)
  <img src="https://i.stack.imgur.com/nnZaQ.png" alt="Image of error">
  Error Page (Text, Same as photo)</p>
  
  <pre><code>ArgumentError in MessageServiceController#put
  wrong number of arguments (1 for 5)
  Extracted source (around line #14):
  
  
  end
  def storeMessage(from_host, to_host, service, message, arguments)
  $fh = from_host
  $th = to_host
  
  Rails.root: -------------------------
  Application Trace | Framework Trace | Full Trace
  
  app/helpers/message_service_helper.rb:14:in `storeMessage'
  app/controllers/message_service_controller.rb:20:in `put'
  
  Request
  
  Parameters:
  
  {"message"=&gt;"9,
  9,
  9,
  9,
  9,
  9"}
  
  Started GET "/message_service/put?message=9,9,9,9,9,9" for 127.0.0.1 at 2015-03-01 14:04:53 +0000
  Processing by MessageServiceController#put as HTML
    Parameters: {"message"=&gt;"9,9,9,9,9,9"}
  
  Completed 500 Internal Server Error in 1ms
  
  ArgumentError (wrong number of arguments (1 for 5)):
    app/helpers/message_service_helper.rb:14:in `storeMessage'
    app/controllers/message_service_controller.rb:22:in `put'
  </code></pre>
  
  <p>This is my controller where the call is made.</p>
  
  <pre><code>class MessageServiceController &lt; ApplicationController
    include MessageServiceHelper
  
    def put
  
      $messageSplit = params[:message].split(",")
  
      $to_host = $messageSplit[0]
      $from_host = $messageSplit[1]
      $service = $messageSplit[2]
      $message = $messageSplit[3]
      $arguments = $messageSplit[4]
  
      storeMessage(from_host:$from_host, to_host:$to_host, service:$service, message:$message, arguments:$arguments)
  
      render :layout =&gt; false
    end
  </code></pre>
  
  <p>This is my helper where the method is implemented. I have other methods in the same helper that are called from the same controller without issue.</p>
  
  <pre><code>  def storeMessage(from_host, to_host, service, message, arguments)
  
      Message.create(from_host:from_host, to_host:to_host, service:service, message:message, arguments:arguments)
  
    end
  </code></pre>
  
  <p>I can't see any problem but I've been trying to figure this out for a day. Note I have looked at the other questions about wrong number of arguments and they seem to be different issues. </p>
  
  <p>Thanks for any help.</p>