# How show message in text file on web page?

**URL:** <https://www.ruby-forum.com/t/how-show-message-in-text-file-on-web-page/168805>\
**Category:** Rails\
**Created:** [May 26, 2009, 9:23am UTC](https://www.ruby-forum.com/t/how-show-message-in-text-file-on-web-page/168805 "2009-05-26T09:23:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ple\_mazako](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5daacb/32.png) [@ple\_mazako](https://www.ruby-forum.com/u/ple_mazako)\
**Post date:** [May 26, 2009, 9:23am UTC](https://www.ruby-forum.com/t/how-show-message-in-text-file-on-web-page/168805/1 "2009-05-26T09:23:35Z")

</div>

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
