Displaying 1 result from an estimated 1 matches for "zed451".
Did you mean:
std451
2013 Jan 07
4
JSON::ParserError in controller
...ror log.
Thanks in advance
Anush
require ''net/http''
require ''open-uri''
require ''uri''
require ''json''
require ''pp''
class Merchant < ActiveRecord::Base
def self.grab_original_content
## EXAMPLE USING ZED451.COM
uri = URI("http://www.zed451.com")
response = Net::HTTP.get_response(uri)
@hash = JSON(response.body)
puts "#{@hash}"
end
end
I call the above method in my controller and send @hash to view.
In my browser I see the below error:
JSON::ParserError in Origi...