I have a HTML/CSS File laid out with a bunch of areas that need adding. I have a ruby on rails application that would have a bunch of form elements that would then need to be added to this HTML/CSS file (it doesn’t need to be shown or anything, just edited and then saved). I don’t really understand how I can do this. I was looking at the file class, but got lost very quickly.
Any easy way to do this?
Writing to a file in Ruby is very simple:
For an example in Rails try the following steps. Generate a new Rails app and a dummy scaffold by running:
Then do something like this in your model:
and then try it out: