How to display file contents from html file

I want to get file contents from html file
after getting i want to display it in the view page.any sample

any helps
Thanks

Newb N. wrote:

I want to get file contents from html file
after getting i want to display it in the view page.any sample

any helps
Thanks

Hi,
As you want html parsing in rails. there are several gems available
for it. one of them is “hpricot”.
for more information refer this
Fast HTML parsing in Ruby with Hpricot.
Hope, this will help you.

Thanks,
Priyanka P.

Priyanka P. wrote:

Newb N. wrote:

I want to get file contents from html file
after getting i want to display it in the view page.any sample

any helps
Thanks

Hi,
As you want html parsing in rails. there are several gems available
for it. one of them is “hpricot”.
for more information refer this
Fast HTML parsing in Ruby with Hpricot.
Hope, this will help you.

Thanks,
Priyanka P.

hi…
@doc = Hpricot.parse(“#{@file_path}”)
i tried like above…can i get all the contents of the file in this @doc
instance variable
can u pls provide me an example

hi…
@doc = Hpricot.parse("#{@file_path}")
i tried like above…can i get all the contents of the file in this @doc
instance variable
can u pls provide me an example

@file_path = d:/temp/History/regst.html

Priyanka P. wrote:

Newb N. wrote:

I want to get file contents from html file
after getting i want to display it in the view page.any sample

any helps
Thanks

Hi,
As you want html parsing in rails. there are several gems available
for it. one of them is “hpricot”.
for more information refer this
Fast HTML parsing in Ruby with Hpricot.
Hope, this will help you.

Nokogiri is supposed to be faster than Hpricot, for what that’s worth.

Thanks,
Priyanka P.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

hi…’
actually i read html file

@content = File.read ("#file_path}")
i dispaly in my view like <%=@content%>
this causes style issues in my page …
why waht is the problem…
pls help me…,.