FAQ: Putting the Form in Formatter - What You'll Be Building

This community-built FAQ covers the “What You’ll Be Building” exercise from the lesson “Putting the Form in Formatter”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Ruby

FAQs on the exercise What You’ll Be Building

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

What does the “!” mean after the method names? This is the first time we’ve seen it, and nothing was mentioned about that in the course content.

1 Like

The answer to the mystery was here:

This marks that method as “dangerous”, as in the method modifies the object itself.

Dangerous:

foo.capitalize!

Not dangerous (since foo remains unchanged):

bar = foo.capitalize

4 Likes

When I answer the questions and hit Run It puts my first name, but then fails to load anything else then times out and gives an “execution expired” message? Anyone else get that?

2 Likes

Yes, I got the same issue. I even entered the information in Repl.it but it couldn’t seem to run properly. I’m not sure why.
Were you ever able to figure out what happened?

What i was doing: replying in the console like first_name=“x”, and then it didn’t run it. So after a while, i just answered the question on the right console where it asks me ,what’s your name?" and then i just typed ,cristiano ronaldo". And that was it. Press enter and next question. I hope it’s clear and it helps!

The code looks like:

print "What’s your first name? "
first_name = gets.chomp

print “What’s your last name?”
last_name = gets.chomp

print “What’s your city?”
city = gets.chomp.upcase (optional)

print “What’s your state?”
state = gets.chomp

Run it like that, and just answer the questions on the right console.

1 Like

You have to reply to the question in the console, where the question is displayed without the code. Not in the box that you are using to write the code. This confused me initally too.

It won’t let me type in the console. Wow, this is the second mistake I’ve come across.

At 1st i could not type in the console either, then i have changed browser and it worked.
No idea why it happened

If you are still unable to type in the console try refreshing the page, clearing your cache, or moving to a different browser.

I have done all of these things and I get the same problem. I hit “run” and then nothing happens for a while and then eventually the console shows a message: execution expired.

There’s clearly a bug here, no?


You probably have a screen similar to this one, but if you don’t the idea is still the same. Before entering input you must click on the gray, blinking rectangle that appears after your question. Then you will be able to type and enter responses.

2 Likes

I live in San Antonio, but when i input it, it only capitalizes the ‘s’… is there a way to split it and loop it to make .Capitalize work for 2 word cities?

Welcome to the forums @davidgarcia719776693! There is a way to capitalize two worded cities and you basically described it yourself! We must first split our user input every time there is a space using the .split(" ") method. Then we can loop through our newly formed array with the .each{} method, capitalizing each item in the array. Finally we can combine our array back into a sentence using the .join(" ") method. Hopefully this helps! If you get confused don’t be afraid to ask for help!

2 Likes

Thanks! I appreciate it, I come from javascript programming, and the tutorial hadn’t taught it, but i finally reached that point :slight_smile:

I am confused, inserted the modified code not the one that is orginal but the one on this forum and it says What’s your first name? execution expired
After I typed in my name?

Having the same issue and put it for the community- can’t move on to the next lesson till I know this is just a bug in the program or what ever runs it

I couldn’t even type in a long city name before “execution expired” while I was typing by the way. As is, this input routine is completely useless for a practical program.

1 Like

“Welcome to the forums @davidgarcia719776693! There is a way to capitalize two worded cities and you basically described it yourself! We must first split our user input every time there is a space using the .split(" ") method. Then we can loop through our newly formed array with the .each{} method, capitalizing each item in the array. Finally we can combine our array back into a sentence using the .join(" ") method. Hopefully this helps! If you get confused don’t be afraid to ask for help!”

I really can’t figure out how the new code would look like. Could you provide us an example??? Thanks!

Make sure to click the console pane before typing, people! I found myself trying different browsers, which didn’t help, before realising a click on the console was necessary after Run.

Perhaps it would help if the lesson could briefly mention this. If Codecademy developers are watching, please do put that in; but in the meantime, I hope this note can help other users.

1 Like