title: Ruby on Rails and JSON parser from URL
body: <p>I use 'gem json' and need load JSON data from some <strong>url</strong>, for example: </p>
  
  <p><code>"http://locallhost:3000/qwerty/give_json.json"</code> with</p>
  
  <pre><code>{"one":"Omg","two":125,"three":"Hu"}
  </code></pre>
  
  <p>I have rails app</p>
  
  <pre><code>class QwertyController &lt; ApplicationController
      require 'json'
  
      def get_json
          source = "http://localhost:3000/qwerty/give_json.json"
          @data = JSON.parse(JSON.load(source))
      end
  end
  </code></pre>
  
  <p>I get error </p>
  
  <pre><code>JSON::ParserError in QwertyController#get_json
  795: unexpected token at 'http://localhost:3000/qwerty/give_json.json'
  </code></pre>
  
  <p>In string:  @data = JSON.parse(JSON.load(source))</p>
  
  <p>What is the matter? How can I get JSON data and parse it? I try @data["one"] ...</p>