Hello Everyone.
There is a method withing controller which is supposed to
- read a text file
- puts its content into the output
Problem: Output shows up in console window while not showing in html
output.
Method itself:
def print_file_contents
file = “path/to/the/file”
infile = File.open(file, ‘r’)
while line = infile.gets
puts line
end
View template (print_file_contents.text.erb) :
<%= hp.print_file_contents %>
Note: the console output is correct. The only problem is it doesn’t
show in the browser.
Thanks in advance.
DonVito.