# Public/images

**URL:** <https://www.ruby-forum.com/t/public-images/87985>\
**Category:** Engines\
**Created:** [March 27, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/public-images/87985 "2006-03-27T23:04:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![twerth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@twerth](https://www.ruby-forum.com/u/twerth)\
**Post date:** [March 27, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/public-images/87985/1 "2006-03-27T23:04:51Z")

</div>

Is there a reason that public/images isn’t overlaid into  
engine\_files/myengine/images the same way javascripts and stylesheets  
are? Is there a way to turn it on?

-todd[1]

---

<div class="post-metadata">

**Author:** ![twerth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@twerth](https://www.ruby-forum.com/u/twerth)\
**Post date:** [March 27, 2006, 11:18pm UTC](https://www.ruby-forum.com/t/public-images/87985/2 "2006-03-27T23:18:39Z")

</div>

Hello,

I also created some images in a new public/images directory this  
evening, and I was wondering if it would copy the images directory,  
and… it did! I did not have to turn anything on. Of course you have  
to restart webrick. If you’re using Apache, I already noticed that it  
does not even copy/update the javascripts and stylesheets directory.

Bart

---

<div class="post-metadata">

**Author:** ![twerth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@twerth](https://www.ruby-forum.com/u/twerth)\
**Post date:** [March 27, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/public-images/87985/3 "2006-03-27T23:45:23Z")

</div>

On 3/27/06, Bart M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,
> 
> I also created some images in a new public/images directory this  
> evening, and I was wondering if it would copy the images directory,  
> and… it did! I did not have to turn anything on. Of course you have  
> to restart webrick. If you’re using Apache, I already noticed that it  
> does not even copy/update the javascripts and stylesheets directory.
> 
> Bart

Thanks Bart

I just needed a restart. I wonder why the directory wasn’t there to  
begin with?

-todd[1]

---

<div class="post-metadata">

**Author:** ![twerth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@twerth](https://www.ruby-forum.com/u/twerth)\
**Post date:** [March 28, 2006, 1:09am UTC](https://www.ruby-forum.com/t/public-images/87985/4 "2006-03-28T01:09:38Z")

</div>

When you start Rails (via a webserver or via the console), it will  
copy _everything_ underneath public/ in your engines into  
subdirectories of the main RAILS\_ROOT/public folder. If you make  
changes to these files, you’ll have to restart your server (or console  
process) to have them re-copied.

When running a webserver, you’ll need to make sure that the user which  
your webserver runs as has permission to write files under /public.

- james

On 3/27/06, Todd W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Bart
> 
> I just needed a restart. I wonder why the directory wasn’t there to begin with?
> 
> -todd[1]
> 
> * * *
> 
> engine-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

–

- J \*  
~

---

<div class="post-metadata">

**Author:** ![twerth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@twerth](https://www.ruby-forum.com/u/twerth)\
**Post date:** [March 28, 2006, 2:52am UTC](https://www.ruby-forum.com/t/public-images/87985/5 "2006-03-28T02:52:05Z")

</div>

Depending on what version of engines you are on, there are also some  
helper  
methods as well…

Engine\_image  
Engine\_image\_src

-Nb

On 3/27/06 3:09 PM, “James A.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Bart  
> > > [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)
> 
> –
> 
> - J \*  
> ~
> 
> * * *
> 
> engine-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

```auto
Nathaniel S. H. Brown http://nshb.net

```

---

<div class="post-metadata">

**Author:** ![twerth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@twerth](https://www.ruby-forum.com/u/twerth)\
**Post date:** [March 29, 2006, 9:42am UTC](https://www.ruby-forum.com/t/public-images/87985/6 "2006-03-29T09:42:46Z")

</div>

At the moment, calling

Engines.copy\_engine\_files(Engines[:your\_engine\_name])

will do it. I’ll make it more convenient in the next release.

- james

On 3/29/06, Subimage [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

–

- J \*  
~

---

<div class="post-metadata">

**Author:** ![twerth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@twerth](https://www.ruby-forum.com/u/twerth)\
**Post date:** [March 29, 2006, 8:22am UTC](https://www.ruby-forum.com/t/public-images/87985/7 "2006-03-29T08:22:58Z")

</div>

Quick, someone write a rake task that copies all public images/js/css  
files over so I don’t have to…

Include it with the next version of engines too 😃
