Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert how to use hpricot in views...

Replytotopic

how to use hpricot in views

Posted in Forums : Ask a Rails expert

 
Warrior

Authority 12
Posting Rating 3
Sign in to rate this post

how to parse xml file in html.erb

<
xml = Hpricot.parse(@chunk_of_xml_data)
data = (xml/:uid) %>
<
data.each { |u| >
<
= u.innerHTML >
<
} %>

 
Me

Authority 62
Posting Rating 100
Sign in to rate this post

This is data-related – you should do build a model (that probably doesn’t need to inherit from ActiveRecord::Base) and wrap that stuff inside a model and then use it in your controllers/views.

Replytotopic

Other Recent Topics

Ask a Rails expert : HTML to XML ---> get title & description

Ask a Rails expert : Accessing controller actions from scripted page?

Ask a Rails expert : seledted option for select_tag

Ask a Rails expert : Merging fields from two tables into one, including duplicates

Ask a Rails expert : saving has_many :through

Ask a Rails expert : Use Rails to develop sites for both Designer and Programmer

Ask a Rails expert : Rails+RS232

Ask a Rails expert : Is this a good way to add Admin section

Ask a Rails expert : RSS feed maker in rails 2.1

Ask a Rails expert : Syncing with ugly legacy databases

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel