%p To your <code>Gemfile</code> add

:coderay
  #!ruby
  gem 'rest-client'
  gem 'json'

%p
  Then run <code>bundle install</code>. Use the following code snippet to get data
  from the API.

- block = capture do
  :coderay
    #!ruby
    # Get data from the morph.io api
    require 'rest-client'
    require 'json'

    # We're always asking for json because it's the easiest to deal with
    morph_api_url = '[scraper_url]/data.json'

    # Keep this key secret!
    morph_api_key = '[api_key]'

    result = RestClient.get morph_api_url, params:
      {
        key: morph_api_key,
        query: "[query]"
      }

    p JSON.parse(result)

= block.sub("[scraper_url]", "#{api_root}<span class='full_name'>#{h(scraper.full_name)}</span>").sub("[api_key]", "<span class='unescaped-api-key'>#{current_user ? current_user.api_key : '[api_key]'}</span>").sub("[query]", "<span class='unescaped-query'>#{h(query)}</span>").html_safe

%p To your <code>Gemfile</code> add

:coderay
  #!ruby
  gem 'rest-client'
  gem 'json'

%p
  Then run <code>bundle install</code>. Use the following code snippet to get data
  from the API.

- block = capture do
  :coderay
    #!ruby
    # Get data from the morph.io api
    require 'rest-client'
    require 'json'

    # We're always asking for json because it's the easiest to deal with
    morph_api_url = '[scraper_url]/data.json'

    # Keep this key secret!
    morph_api_key = '[api_key]'

    result = RestClient.get morph_api_url, params:
      {
        key: morph_api_key,
        query: '[query]'
      }

    p JSON.parse(result)

= block.sub("[scraper_url]", "#{api_root}<span class='full_name'>#{h(scraper.full_name)}</span>").sub("[api_key]", "<span class='unescaped-api-key'>#{current_user ? current_user.api_key : '[api_key]'}</span>").sub("[query]", "<span class='unescaped-query'>#{h(query)}</span>").html_safe

Use consistent quoting for example ruby code
Use consistent quoting for example ruby code

Also makes sure that double quotes are inside single quotes and not the other way around
