Forum: Ruby on Rails calling partials from public/*.html?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
18103d7fdd3e21c2b64e59d27e339549?d=identicon&s=25 David Humphreys (Guest)
on 2006-03-09 22:16
(Received via mailing list)
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 Humphreys
dave@dbhumphreys.com
3319ab6fb19fcf97c8a3d66b8a9b68bf?d=identicon&s=25 Josh on Rails (Guest)
on 2006-03-09 22:28
(Received via mailing list)
On 3/9/06, David Humphreys <dbhumphreys@gmail.com> 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
6f7c877de704c7cc03c8a3b2dc52df92?d=identicon&s=25 Carmen --- (carmen)
on 2006-03-09 23:01
>> 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..
Cb610750ee94ca103aef4b2dc7b1b768?d=identicon&s=25 Nick Stuart (Guest)
on 2006-03-09 23:04
(Received via mailing list)
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
This topic is locked and can not be replied to.