Build a Breadcrumb Generator in Ruby

0
861

This guide walks through how to build a breadcrumb generator that converts an array to a slash-separated string.

Summary

Create a method that builds a breadcrumb based navigation.

Exercise File

Code File

Exercise Description

Given an array of strings, build a method that converts the strings into a single string where each element is separated by a /.

Sample Input

['String 1', 'String 2', 'String 3']

Expected Output

'String 1 / String 2 / String 3'

Real World Usage

When it comes to building Rails applications, it’s a common requirement to implement view helper methods. This exercise will test your ability to convert an array of strings into a single object that is properly formatted.

Solution

Can be found on the solutions branch on github.

LEAVE A REPLY

Please enter your comment!
Please enter your name here