Forum: Ruby on Rails Render HTML in RHTML

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
68e62d138d6f78cc2643f26aeb2b2922?d=identicon&s=25 hussain (Guest)
on 2007-06-16 08:49
Hai guys
I have one question to all the experts in Rails
That question is ,I have one HTML file with some css attached in my
rails root.
I need to display that HTML file in our RHTML file
can you tell me the answer?
8608f2d7f02c6d0f1c349b7b94b1cea5?d=identicon&s=25 liquidautumn (Guest)
on 2007-06-16 09:47
(Received via mailing list)
What you really need is your html file moved somewhere under app/
views, renamed to _htmlfile.rhtml and rendered as partial in your
rhtml template, like <%= render :partial => 'htmlfile' %> or
something. Possibly, but unlikely, I am missing some very unusual need
to keep things as you did, more detailed explanation would help make
things clearer. Don't try to provide abstract description, better try
to be as specific as it ever possible, or you'll get lots of answers
barely applicable to your case.
588ab1c0a5610a7e160a3b101abb91e6?d=identicon&s=25 MichaelLatta (Guest)
on 2007-06-16 09:47
(Received via mailing list)
The problem as stated is harder than it needs to be.  If the HTML
content could be placed in a file under the views directory tree, and
the name starts with an "_" then just render :partial => ...

If it needs to reside there you can always provide the full path name
to the render method, or use render :text => ... after reading the
file into memory.

This topic is locked and can not be replied to.