Calling partials from public/*.html?

Can I call partials from html files in public?

Is this wise?

I’ve got a bunch of html files and I’d like to let them have access to
pieces of Rails, but I’d like to manage them through Contribute or
some such.

I could wiki them up, but that seems like a lot of work for pages that
don’t get updated that often (yearly or so).

Thanks in advance!

  • Dave


David H.
[email protected]

On 3/9/06, David H. [email protected] wrote:

Can I call partials from html files in public?

Is this wise?

You probably could, but it wouldn’t be easy.

I don’t know how many files you’d have to change, but I can’t imagine it
being worth the effort.

– Joshua

Can I call partials from html files in public?

You probably could, but it wouldn’t be easy.

I don’t know how many files you’d have to change

it’s easy, and none. see public/index.html in a fresh 1.1/trunk
install… it already dynamically updates part of the page…

It actually wouldnt be that hard. Not sure the correct syntax, but
something
like:

def render_something(something)
IO.read("#{RAILS_ROOT}/public/#{somthing}")
end
(again syntax may be off, but the idea is the same)

This simply reads the HTML file (or whatever something is) and returns
it.
Put this in application.rb and you can now render anything in your
public
folder.

-Nick