-1

I want to make a request to a URL:

url = http://localhost:3000/api/v1/new_car/car_makes/:make/detail

When I run:

query[:make] = "honda"
HTTParty.get(url, :query => query, :headers => @headers)

I receive:

params[:make] #=> nil

and receive the parameter value:

params["make"] #=> ":make"

How can I fix it?

Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133

1 Answers1

1

You can do

    params = params.with_indifferent_access

you will be able to access in both ways

    params["make"] and params[:make]