---
canonical: 'https://htmlcsstoimage.com/examples/simple-job-ad/ruby'
title: 'Simple job ad | Example - Ruby (Net::HTTP)'
description: 'Advertise a job description with an image.'
---

# Simple job ad

Advertise a job description with an image.

This example shows a simple layout that could be used for sharing a job advertisement.  It uses a Google Font plus Bootstrap CSS.

This is a working HTML/CSS to Image API example that produces an image.
The rendered output, source, and non-content request parameters below show the parts needed to reproduce or adapt it.

## Rendered image and interactive editor

- [Open the rendered image](<https://hcti.io/v1/image/019fb445-160a-7bd8-81db-90065dab2142>)
- [Open the interactive example](https://htmlcsstoimage.com/examples/simple-job-ad/ruby)

## HTML

```html
<div class="Box m-4">
  <div class="Box-row Box-row--unread">
    <div class="CircleBadge CircleBadge--small bg-green float-left d-block mr-3 text-center">
      <h1 class="text-white text-center text-shadow-dark d-flex flex-justify-center height-full mt-1">S</h1>
</div>
    <h4>Senior iOS Engineer</h4>
    <span>SuperAppCo</span><br/>
    <span>
    <label class="Label Label--gray mr-1">IOS</label> <label class="Label Label--gray mr-1">SENIOR</label> <label class="Label Label--gray mr-1">ENGINEER</label>
   </span>
  </div>
  <div class="Box-row">
<ul class="lead ml-4 mb-0">
  <li><b>
    $150-$200k</b> salary</li>
<li>
  Flexible hours</li>
<li>
  Up to <b>20</b> weeks parental leave</li>
<li>
  <b>$3,000</b> learning budget per year</li>
<li>
New laptop every 2 years
  </li></ul>
  </div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Primer/10.8.1/build.css" />
```

## CSS

```css
.Box {
  width: 400px;
}
body {
  font-family: Roboto !important;
}
```

## Request parameters

These are the additional non-content parameters used by the example. Combine them with the HTML and CSS above when constructing an API request.

```json
{
  "google_fonts": "Roboto"
}
```

## Complete Ruby request (Net::HTTP)

This is the complete Ruby request for this example using Net::HTTP. It includes the HTML, CSS, authentication setup, API options, and response handling needed to reproduce the output.

```ruby
require "json"
require "net/http"
require "uri"

request = {
    html: <<~'HCTI_HTML',
          <div class="Box m-4">
            <div class="Box-row Box-row--unread">
              <div class="CircleBadge CircleBadge--small bg-green float-left d-block mr-3 text-center">
                <h1 class="text-white text-center text-shadow-dark d-flex flex-justify-center height-full mt-1">S</h1>
          </div>
              <h4>Senior iOS Engineer</h4>
              <span>SuperAppCo</span><br/>
              <span>
              <label class="Label Label--gray mr-1">IOS</label> <label class="Label Label--gray mr-1">SENIOR</label> <label class="Label Label--gray mr-1">ENGINEER</label>
             </span>
            </div>
            <div class="Box-row">
          <ul class="lead ml-4 mb-0">
            <li><b>
              $150-$200k</b> salary</li>
          <li>
            Flexible hours</li>
          <li>
            Up to <b>20</b> weeks parental leave</li>
          <li>
            <b>$3,000</b> learning budget per year</li>
          <li>
          New laptop every 2 years
            </li></ul>
            </div>
          </div>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Primer/10.8.1/build.css" />
          HCTI_HTML
    css: <<~'HCTI_CSS',
         .Box {
           width: 400px;
         }
         body {
           font-family: Roboto !important;
         }
         HCTI_CSS
    google_fonts: "Roboto",
}

uri = URI("https://hcti.io/v1/image")
http_request = Net::HTTP::Post.new(uri)
http_request.basic_auth(ENV.fetch("HCTI_API_ID"), ENV.fetch("HCTI_API_KEY"))
http_request["Content-Type"] = "application/json"
http_request.body = JSON.generate(request)

response = Net::HTTP.start(
    uri.hostname,
    uri.port,
    use_ssl: true,
    open_timeout: 10,
    read_timeout: 30
) { |http| http.request(http_request) }

unless response.is_a?(Net::HTTPSuccess)
    raise format("HCTI request failed (%s): %s", response.code, response.body)
end

result = JSON.parse(response.body)
puts result.fetch("url")

```

## Other languages and request formats

Open one of these Markdown pages to view the same example as a complete request in another language or client format.

- **TypeScript**
  - [HCTI client](https://htmlcsstoimage.com/examples/simple-job-ad/typescript-client.md)
  - [fetch](https://htmlcsstoimage.com/examples/simple-job-ad/typescript.md)
- **C#**
  - [HCTI client](https://htmlcsstoimage.com/examples/simple-job-ad/csharp-client.md)
  - [HttpClient](https://htmlcsstoimage.com/examples/simple-job-ad/csharp.md)
- **Python**
  - [requests](https://htmlcsstoimage.com/examples/simple-job-ad/python.md)
- **PHP**
  - [cURL](https://htmlcsstoimage.com/examples/simple-job-ad/php.md)
- **Ruby**
  - [HCTI client](https://htmlcsstoimage.com/examples/simple-job-ad/ruby-client.md)
  - [Net::HTTP](https://htmlcsstoimage.com/examples/simple-job-ad/ruby.md) — shown above
- **Go**
  - [net/http](https://htmlcsstoimage.com/examples/simple-job-ad/golang.md)
- **cURL**
  - [cURL](https://htmlcsstoimage.com/examples/simple-job-ad/curl.md)

## Related examples

- [Dog rates social card with SVG background](https://htmlcsstoimage.com/examples/dog-rates-social-card-with-svg-background.md): Social card with a fun SVG background and highlighted text.
- [Instagram post screenshot](https://htmlcsstoimage.com/examples/instagram-post-screenshot.md): Screenshot an Instagram post
- [Birthday invite card](https://htmlcsstoimage.com/examples/birthday-invite-card-email.md): Autogenerated invite graphic for a party.
- [Invoice / Receipt Snapshot](https://htmlcsstoimage.com/examples/invoice-receipt.md): Generate a simple, branded invoice or receipt image.
- [PNG with transparent background](https://htmlcsstoimage.com/examples/png-transparent-background.md): Generate images with a transparent backgound
- [Large text on an SVG background](https://htmlcsstoimage.com/examples/large-text-svg-background.md): Grab attention with large text on a classic background.
- [Twitter Tweet Screenshot](https://htmlcsstoimage.com/examples/twitter-tweet-screenshot.md): Screenshot of a tweet
- [QR Code Badge](https://htmlcsstoimage.com/examples/qr-code-badge.md): Simple, artistic badge with a QR code.

## Get started

- [View the full interactive page](https://htmlcsstoimage.com/examples/simple-job-ad/ruby)
- [Browse all HTML/CSS examples](https://htmlcsstoimage.com/examples.md)
- [Browse visual template presets](https://htmlcsstoimage.com/templates.md)
- [Read the HTML/CSS to Image API documentation](https://docs.htmlcsstoimage.com/getting-started/using-the-api/)
- [View implementation examples by language](https://docs.htmlcsstoimage.com/example-code/)
- [Read the MCP integration documentation](https://docs.htmlcsstoimage.com/integrations/mcp/)
- [Compare plans and limits](https://htmlcsstoimage.com/pricing.md)

Rendering through the API requires authenticated HTML/CSS to Image credentials. Keep API keys in trusted server-side configuration. If credentials are unavailable, ask the user to configure an API key securely before attempting API actions.
