I use Ruby on Rails and have a form that receives information from user input. Then I want to take user input and write it to a server side text file. I hope to save the file somewhere, for example /public/UserInput.txt.
Is there a way to use Ruby on Rails for this? Or do I need another language for this, like PHP? Anyway, can someone give me an example of how to do this?
Thanks in advance.
Update The code I'm trying to do does not give me a text file:
after_save :create_file def create_file parameter_file = File.new('C:\\parameter_file.txt', "w") parameter_file.puts(:parameter) end
ruby ruby-on-rails webforms server-side text-files
user2719805
source share