how to use hpricot in views

L

Lost Warrior

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

Gregory Seidman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
sxarexu

Latest Threads

Top