[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to use hpricot in views

Lost Warrior

7/24/2008 10:26:00 AM

how to parse xml file in html.erb
<%
xml = Hpricot.parse(@chunk_of_xml_data)
data = (xml/:uid) %>
<% data.each { |u| %>
<%= u.innerHTML %>
<% } %>
--
Posted via http://www.ruby-....

1 Answer

Gregory Seidman

7/24/2008 12:59:00 PM

0

On Thu, Jul 24, 2008 at 07:25:51PM +0900, Lost Warrior wrote:
> how to parse xml file in html.erb
> <%
> xml = Hpricot.parse(@chunk_of_xml_data)
> data = (xml/:uid) %>
> <% data.each { |u| %>
> <%= u.innerHTML %>
> <% } %>

This does not belong in the view. Put it either in the controller or the
helper.

--Greg