Ruby Gem - Can't Convert String Into Integer Error
I am using the a2z gem to work with Amazon's Product Advertising API and
I'm running into this issue with the gem when I try to specify multiple
product_ids into an item_lookup request. Is this something I can fix, or
do I have to contact the gem author?
can't convert String into Integer
Here is my code:
def product_lookup
# Check which Retailer this is for
case params[:retailer]
when "amazon"
client = A2z::Client.new(key: ENV["AMAZON_PAAPI_KEY"], secret:
ENV["AMAZON_PAAPI_SECRET"], tag: ENV["AMAZON_PAAPI_TAG"])
product_ids = []
product_ids << product_one_id = params[:product_one_id]
product_ids << product_two_id = "B00D43QGPS"
product_ids = product_ids.join(",")
@products = client.item_lookup do
id product_ids
response_group 'Small, Images, OfferListings'
end
render :json => @products
end
end
No comments:
Post a Comment