+ 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.
8 ответов
+ 3
variable = gets
puts variable
input will already be string 😀
+ 4
Not easily.
Ruby is not like the web languages.
Depends where the test box will be, whether desktop or web app.
+ 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)
+ 3
add more gets or
variable = gets.chomp.split(“ “)
to chain multiple inputs in one variable once you start getting into arrays.
+ 1
Awesome, thanks Choe ! Very helpful.
+ 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.
0
Choe Awesome, thank you! How about multiple inputs/text fields?
0
Manual Web app