Sinatra Mvc Lab

In this lab, you'll be building a Pig Latinizer using Sinatra and the MVC paradigm of app development. Pig Latin is a made-up language formed from English by transferring the initial consonant or consonant blend (for example, "ch" or "str") of each word to the end of the word along with the syllable "-ay". If the word begins with a vowel sound, then we add the sound of "way" to the end of the word.

Examples:

"noodle soup" becomes "oodlenay oupsay" "flatiron school" becomes "atironflay oolschay" "big apple" becomes "igbay appleway" (note the added "w" in "appleway")

Your app will take in a string from a user through a form, convert it to pig latin, and return the string to the user. Using the previous code-along as a guide, get the tests to pass by building out this application. Use the guide below to get you started!

Instructions

  1. Build a form to take user input in user_input.erb. Show that form using a GET request at /.

  2. Create a POST method in your controller (app.rb) to receive your form's params.

  3. Build a PigLatinizer model (in your models directory) that converts a string into pig latin.

  4. In your application controller, create an instance of the PigLatinizer class to convert your user input to Pig Latin.

  5. Use ERB within a new view to display the final pig latin string to the user.

Pig Latin on wikipedia

View Sinatra MVC Lab on Learn.co and start learning to code for free.

Unlock your future in tech
Learn to code.

Learn about Flatiron School's Mission

With a new take on education that falls somewhere between self-taught prodigy and four-year computer science degree, the Flatiron School promises to turn students with little programming experience into developers.

In the six months since the Manhattan coding school was acquired by WeWork, it has spawned locations in Washington, D.C., Brooklyn, and London. Now, WeWork is opening a fourth Flatiron School location, this time in Houston.

Adam Enbar, Flatiron School's cofounder, believes now is the time to grow. "How the world is changing has impacted working and learning in very similar ways. We think education fundamentally is about one thing: enabling people to pursue a better life."

Learn. Love. Code.
Students come to Flatiron School to change their lives. Join our driven community of career-changers and master the skills you need to become a software engineer or a data scientist.
Find Us