From: Adam Shelly Date: 2007-12-14T05:02:02+09:00 Subject: Re: Showing Running Processes in variable On 12/13/07, jackster the jackle wrote: > Thanks for the help Darren....what you proposed works but it doesn't > print out the processes in a viewable table in rails....I think I > somehow need to add a "\n" or a line break to the result....This might I'm not a web guy, but... You need a
to generate a newline in html, right? > be a rails question now but just in case you might know, here is what I > have in my controller: > > def processes > x=`ps -el` > y=x.split("\n") > y.each do |line| > end > return y > end > The each statement does nothing there, and the return is redundant. How about just def processes `ps -el`.gsub(/\n/,"
") end -Adam