Build an HTML Heading Generator in Ruby
In this Ruby coding exercise you'll learn how to build an HTML H1 heading generator that takes in a title and outputs a full HTML title.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
  • Complete the Exercise
Video locked
This video is viewable to users with a Bottega Bootcamp license

Summary

Build a program that dynamically generates an HTML H1 heading tag.

Exercise Description

Given the following string:

"My Title"

Write a program that generates an HTML H1 heading.

Sample Input

"My Title"

Sample Output

"<h1>My Title</h1>"

Real World Usage

String interpolation is common in everyday Ruby and/or Rails development. This particular exercise has a number of solutions, including a standard string based approach, along with an array based strategy.

Test Cases

Code File