开发者

Hpricot and Rails Rendering

开发者 https://www.devze.com 2023-03-29 01:58 出处:网络
I finally managed to get Hpricot and Rails working together as below: parser_controller: def deck require \'hpricot\'

I finally managed to get Hpricot and Rails working together as below:

parser_controller:

def deck require 'hpricot' require 'open-uri' @doc = open("http://www.keo.co.za/") { |f| Hpricot(f) } end end

deck view:

<%=(@doc/"#list-of-posts h2 ").inner_html%>

which gives me:

KeoTV: D-Day for desperate Boks

Which is awesome, but now I want to render 开发者_如何学Goit in a list instead of it just showing me html in one single line? How can I make it show it to me in another output visibly instead of just HTML?

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消