Good afternoon, dear community!
I do not know how to correctly formulate my question. I've been trying in vain to find the answer to my question for several days now, but everywhere I come across Rails tutorials. But I don't want to use rails or any other frameworks. Surely my task can be solved without using them.
I have, for example, the index.html file:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <form> <label for="total"> Укажите сумму: </label> <input type="text" name="total" id="total" required="required"> <input type="submit" value="Сохранить"> </form> </body> </html> And there is, for example, the file main.rb:
require "sqlite3" db = SQLite3::Database.open "salary.sqlite" total = gets.chomp db.execute "INSERT INTO salary (total) VALUES (?)", [total] db.close if total >= 1 puts "Всё ОК!" else puts "Что-то пошло не так..." end Tell me, please, how can I transfer the value of the attribute that the user fills in the form in index.html to the main.rb ruby file so that he, in turn, saves the data to the database?
Many thanks in advance for your help!