I have a problem with transfer ”&” to ”&” in the URL.
When my system request an API from another system then my system display the API responses with the new tab.
The response is a URL that contains two value separated by &
The & in the URL is transfers to & which it causes an issue to my system.
URL example in the attached image enter image description here
The right URL shall be xxxxxxrid=1182&eid=25
backend code
def url_with_params(reservation_id)
"#{self.url}?rid=#{reservation_id.to_s}&eid=#{self.id.to_s}"
#URL ex: https://XXXXXXXXXXXX?rid=1184&eid=1.
end
client-side code
$(document).on("click", '.dev-submit-instructions-agreement', function(){
window.open("<%= @exam.url_with_params(@reservation.id) %>", 'newwindow', 'width='+screen.width+', height='+screen.height);
});