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.
David H. (Guest)
on 2006-03-09 23: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 H.
removed_email_address@domain.invalid
Josh on Rails (Guest)
on 2006-03-09 23:28
(Received via mailing list)
On 3/9/06, David H. <removed_email_address@domain.invalid> 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
Carmen -. (Guest)
on 2006-03-10 00: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..
Nick S. (Guest)
on 2006-03-10 00: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.