How to reference the "public" folder from "app/views/..."

Hello,

In my application.html.erb layout I have a reference to a .swf (flash
movie) file that I want to embed. I put the swf file in the
“public/flash” directory (I created the “flash” folder).

My question is how do I get a reference to the “public” folder that
rails created from within a view template that is in “app/views/etc…” ?
So that I can do something like:

The “…” doesn’t point to the application root so I don’t know how else
to access the public folder.

I’m not really sure what the “root” is when it comes to the html that
rails uses. When rails translates all the .html.erb stuff to plain html
where does this all run from? For example when you check the source
code of a page from a browser you can see plain html that rails
generated using all its fancy methods. But where does this plain html
live? Is it generated on the fly upon request and then disappears into
thin air?

I’ve always been confused about this “html.erb” to “html” magic and any
clarification on the matter is greatly appreciated.

(Sorry for the 2 questions in one)

Thanks in advance.

/public is the root of the public site… so just

On Fri, Jan 30, 2009 at 10:43 AM, Nebs P.
[email protected] wrote:

thin air? >


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting w/Ruby on Rails

http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]