Thanks to both of you!

I checked both of the code you guys suggested and it worked fine. 
However there is still a problem.

I am developing an application for a ruby class I am in, and I would 
like to edit some of that .erb file in an HTML textarea. I am using 
Ruby/Sinatra, and here is what happens:

If I print the data into a <div>, it will show everything including the 
doctype, body, etc.

Yet when I do this:

<textarea cols="93" rows="32" name="contents">
   <% File.open("views/layoutAdmin.erb") do |file| %>
      <% file.each_line do |line| %>
         <%= line %>
      <% end %>
   <% end %>
</textarea>

The textarea will take away all of the aforementioned tags. Like I said 
before, if I replace the <textarea> tags with <div> tags, it works fine, 
but I of course can't edit that content.

Is there some reason why textareas do not display this data?

-- 
Posted via http://www.ruby-forum.com/.