From: Brian Candler Date: 2010-04-28T17:29:24+09:00 Subject: Re: Issue in getting a pop up Ravi dk wrote: > Here i am using all.each{|row| to consider all the rows and columns for > the final report. Please let me know the alternative so that i have to > print only 2 columns out of 3(let`s say) and entire number of rows. <% all.each do |row| %> <%= row[0] %> <%= row[1] %> etc <% end %> You are currently using row.join("sep") which joins all the array elements together. If 'all' is an Array of Arrays, then the total number of rows is <%= all.size %> Note that you should be HTML-escaping the values before inserting them into the page (consider what happens if row[0] contains < or &). To keep the templates simple you could define a helper method 'h' like Rails does. Then you'd use it like this: <%=h row[0] %> -- Posted via http://www.ruby-forum.com/.