In this when I am passing phone as string in params rails api, it is being passed in the form of "\"9650661678\"". How to use escape string or how to encode it so that only string can be entered as input.
Any help will be welcomed ! Thanks in advance.
clients_controller.rb
def myzenica
mobile = params[:phone]
client = Client.where(:phone => mobile)
render :json => client
end
terminal
Started GET "/clients/myzenica?phone=%229650661678%22" for 127.0.0.1 at 2016-03-15 11:21:23 +0530
Processing by ClientsController#myzenica as */*
Parameters: {"phone"=>"\"9650661678\"", "client"=>{}}
Client Load (0.3ms) SELECT `clients`.* FROM `clients` WHERE `clients`.`phone` = '\"9650661678\"'
Completed 200 OK in 2ms (Views: 0.7ms | ActiveRecord: 1.2ms)