ruby - Turning a json string into a URL encoded string (Rails) -
ruby - Turning a json string into a URL encoded string (Rails) -
how convert json var
email = {"email":"name@gmail.com"}
into encoded string?
%7b%22email%22%3a%22name%40gmail.com%22%7d
sure can utilize uri
library shown here
[2] pry(main)> require 'uri' => true [3] pry(main)> uri.encode('{"email":"name@gmail.com"}') => "%7b%22email%22:%22name@gmail.com%22%7d"
ruby-on-rails ruby json
Comments
Post a Comment