I have the following code in my routes.rb file -
post "/webhooks/process/:webhook_source", controller: :webhooks, action: :process
What is expected is that it would pass the webhook_source
as a param in the action.
Here is the action -
def process(webhook_source)
puts "========="
puts webhook_source
puts "========="
case params[:webhook_source]
when 'razorpay'
process_razorpay(params)
end
head :ok
end
If I don't have the argument webhook_source
, I get the error -
ArgumentError (wrong number of arguments (given 1, expected 0)):
Here is the full stack track for reference as well.
And the puts of webhook_source
just returns process
.
I'm unsure of how to get rid of the argument which I think is redundant.