So I have a show.rhtml that displays XML data generated from perl. The column headers are the element tags in the XML, enclosing the data. I have two questions 1) How would I make the columns sortable when a user clicks on the column header; ASC/DESC? 2) How would you create a text box that would allow me to filter the results? For instance, if a column was labeled "State", I could switch the filter to state, and Just type a "T", and only rows with a state starting with a T would be displayed. Is there a plugin or an easy way to do these two things? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Here is my table ion the show.rhtml <table class="standard"> <thead> <tr> <% link_index = nil @report.columns.each do |col| if(col.name.downcase == ''link'' || col.name.downcase == ''label'') link_index = col.name -%> <th>Drill Down Avail</th> <% else -%> <th><%= col.human_name %></th> <% end end -%> </tr> </thead> <tbody> <%= ''<p class="no_results">Sorry, no results were found with the supplied parameters</p>'' if @report.rows.size == 0 %> <% @report.rows.each do |row| if link_index -%> <tr class="clickable <%= cycle("", "shade") -%>" onclick="window.location=''<%= url_for :action => ''drill_down'', :params => { :url => CGI.escape(row[link_index])} %>''"> <% else -%> <tr class="<%= cycle("", "shade") -%>"> <% end @report.columns.each do |col| if (col.name != link_index) -%> <td><%= row[col.name] %></td> <% else -%> <td><%= link_to ''+'', :action => ''drill_down'', :params => { :url => CGI.escape(row[link_index])} %></td> <% end end -%> </tr> <% end -%> </tbody> </table> -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
will_paginate MAY do what I need, but I am not reading from a table. I do a call to a perl script which returns an XML stream/response that ruby catches. the examples I am seeing is reading from a table. How would I do set this up when the data is coming from an XML stream and not a database? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---