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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -