+ 1

How to implement user input?

How would I make a text box for user to input which then determines the value of a variable with a string when outputted.

9th May 2019, 12:41 AM
boltCodes
boltCodes - avatar
8 Answers
+ 3
variable = gets puts variable input will already be string 😀
9th May 2019, 1:11 AM
Choe
Choe - avatar
+ 4
Not easily. Ruby is not like the web languages. Depends where the test box will be, whether desktop or web app.
9th May 2019, 12:59 AM
Manual
Manual - avatar
+ 4
WaffleRuby You use and html form. Then you have ruby store the data, then use the stored data. I plan to do it soon using ruby on rails. I do not know your experience. To do I as I would, you need to have fullstack developments skills. If you do it alone. Without others doing other parts of the project. Requires. Html5 Ruby and Rails experience Database experience ( I use sqlite or PostgreSQL)
9th May 2019, 6:21 PM
Manual
Manual - avatar
+ 3
add more gets or variable = gets.chomp.split(“ “) to chain multiple inputs in one variable once you start getting into arrays.
9th May 2019, 2:05 AM
Choe
Choe - avatar
+ 1
Awesome, thanks Choe ! Very helpful.
12th May 2019, 8:40 AM
boltCodes
boltCodes - avatar
+ 1
Manual Yeah, that makes sense. I have experience with HTML and CSS, but am a beginner to Ruby, and haven’t begun learning Rails yet.
12th May 2019, 8:41 AM
boltCodes
boltCodes - avatar
0
Choe Awesome, thank you! How about multiple inputs/text fields?
9th May 2019, 1:49 AM
boltCodes
boltCodes - avatar
0
Manual Web app
9th May 2019, 1:50 AM
boltCodes
boltCodes - avatar