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.
Error Page (Photo)
Error Page (Text, Same as photo)
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"=>"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"=>"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'
This is my controller where the call is made.
class MessageServiceController < 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 => false
end
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.
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
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.
Thanks for any help.