Rails plugin with Javascript file

Hi, last question of the day (promise!!!)

I’m packaging up some work into a plugin. One of the parts is a
javascript file currently in “public/javascripts”. I thought I’d be able
to move it to “vendor/myplugin/public/javascripts” or
“vendor/myplugin/javascripts” or even “vendor/myplugin/lib” but none of
these worked.

Is it possible to have a “js” file in a plugin and, if so, how do I do
it?

Uncortunately, Creating plugins isn’t mentioned in the Agile book and
Google drew a blank to this particular question.

Hey,

You may want to look at http://www.activescaffold.com/ plugin for where
they
keep a js file with in plugin directory.

-Jatinder

On 8/11/07, John L. [email protected] wrote:

Is it possible to have a “js” file in a plugin and, if so, how do I do
it?

You might also want to look at the engines plugin (http://rails-
engines.org), which makes it trivially easy to include public assets
in plugins and have them servable by your web server.


James

James A. wrote:

You might also want to look at the engines plugin (http://rails-
engines.org), which makes it trivially easy to include public assets
in plugins and have them servable by your web server.

This rails-engine looks like the answer. I shall try it out. Thanks!