I have a text file that has data in it which is perfectly formatted the
way I want it.
I have the following code in my controller to open the file and read
each line into an array which I then call from my view. The problem is,
I completely loose the formatting the way I'm doing it:

- from my controller:
<code>
def index
        @ssh = Array.new
        a = File.open("/usr/bin/my_data.dat")
        a.each do |line|
           @my_data.push(line)
        end
end
</code>

-from my view:
<code>
<%= @my_data %>
</code>

I'm thinking that maybe I shouldn't put the data in an array or maybe I
should somehow loop through the array in my view in order to maintain
the formatting of the text file?

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to