furfey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-23 20:53 UTC
fetch html and strip tags
I''ve got this statement in a view <% open(bill.bill_url).read %> It''s grabbing a url from the db and displaying the html code fine. But I''d like to just display the contents of one tag. Is there an easy way to strip tags, or choose just one? Or, will I have to use something like hpricot? Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you just want to strip HTML tags take a look at the white_list plugin, http://www.agilewebdevelopment.com/plugins/whitelist. If you need to do more specific things, Hpricot is a good option. Kind regards, Nick Snels http://railshostinginfo.com Compare Rails hosting -- 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 -~----------~----~----~----~------~----~------~--~---