TTY:Prompt Menu Help

Rashad Walcott
Rashad’s Tech Blogs
3 min readAug 21, 2019

I am currently on this coding journey as I am attending Flatiron School for software engineering. So far I have been really excited about this new experience. On the other hand it isn’t without frustration.

I have realized that “Google” becomes a really close friend in helping you search for coding errors and just simply looking for ways to execute an idea you may have. However, one of the biggest challenges I have found in the coding community is the explanation of how to do certain things. Having come from a military background I believe in keeping things “Barney Style”, where you explain things as simple as you can. I have found tons of resources and explanations for things but sometime’s it is really hard to grasp from the images laid out or the suggestions you come across.

I recently had to do a project for my class and I ran across TTY::Prompt, which had me super psyched because of what I could do with it to help my application look a lot more clean. I was looking for a way to link back my menu to different options but was super unsure as to how to execute this without a whole ton of code. So of course I went to my friend “Google” and found some examples.

This is how you would link a method to your menu choice

The code above is the sort of examples I came across while searching. Keep in mind I have never used this before so looking at this I am unsure what it is this code is actually doing. Specifically the part where the arrows are pointing to “Edit”. It took me a while and conferring with other classmates before I figured out what this was.

Long story short what you see above is the menu choice “Edit Account” is leading to a method that I have written in my code. I want when the user clicks on that choice for them to be lead to the option to edit their account which looks like this.

An example of the edit method which is linked to the menu choice from the previous picture

Now as you can see, there is the method that is shown previously with an arrow leading to it from the menu choice. Here you can clearly see two things working together to give you your options. Keep in mind this method also has other methods linked to it as well!

This is pretty simply but I wanted to put this out there and show how things are relating to each other and hopefully help someone out there that is starting their coding journey and has to see how things work instead of trying to read in between the lines with the amount of different resources we find on the internet. Happy coding ya’ll!

--

--