Forum: Ruby on Rails how show message in text file on web page?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Thiti P. (Guest)
on 2009-05-26 11:23
(Received via mailing list)
Hello,
i want to read text file and then want to show message in text file on
web page.pls, introduce me how i can do. now i cant read file but i
don't know how write script on rhtml for show the massage in text
file.

this is code in controller
def show
   f = File.open("/...../test.txt,"r")
     while (line = f.gets)
     end
   f.close()
end
pls, help me what next step i do?
thank you
This topic is locked and can not be replied to.