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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -