# Can I use standard Rails plugin?

**URL:** <https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358>\
**Category:** Radiant CMS\
**Created:** [November 6, 2007, 11:53am UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358 "2007-11-06T11:53:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 6, 2007, 11:53am UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/1 "2007-11-06T11:53:39Z")

</div>

Hi all,  
I noticed that my sites losts a lot of time loading js e css file. I  
searched for a solution and I found this great rails plugin:  
[http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript](http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript)

but I don’t know how can I use it in radiant.

I tried to export it in vendor/plugins and modifing config/routes.rb as  
explained… but I’ve produced only an Application error…

Any suggestion?

bYe!  
Andrea

---

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 6, 2007, 12:45pm UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/2 "2007-11-06T12:45:29Z")

</div>

On 11/6/07, Andrea O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,  
> I noticed that my sites losts a lot of time loading js e css file. I  
> searched for a solution and I found this great rails plugin:  
> [http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript](http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript)
> 
> but I don’t know how can I use it in radiant.

I usually create a radiant page called javascripts that loops through  
its children…each children it’s a js page…then from my layout a  
call only one js file (/javascripts) that contains all my js code. It  
should be cool to add a new Filter that use jsminifier to compress all  
the code…what do you think?

---

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 6, 2007, 1:20pm UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/3 "2007-11-06T13:20:36Z")

</div>

Andrea F. wrote:

> On 11/6/07, Andrea O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hi all,  
> > I noticed that my sites losts a lot of time loading js e css file. I  
> > searched for a solution and I found this great rails plugin:  
> > [http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript](http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript)
> > 
> > but I don’t know how can I use it in radiant.
> 
> I usually create a radiant page called javascripts that loops through  
> its children…each children it’s a js page…then from my layout a  
> call only one js file (/javascripts) that contains all my js code. It  
> should be cool to add a new Filter that use jsminifier to compress all  
> the code…what do you think?

Normally I take js & css as separated static file. I use radiant as cms  
for my clients… and so I prefer to leave basic layout css and js file  
not editable. 😃

jsminifier is only a small compressing “utility”… it clear spacing and  
unusefull chars only. The real plus about using the plugin I’ve posted  
before is that it gzip files on the fly! 😃

Take a look at this site: [http://www.indiaandmore.com](http://www.indiaandmore.com)  
I have:  
12kb xhtml code  
14kb css code  
170kb image file (huge, I know 😃 but are the same for all the site)  
25kb swf (I use sfir for graphical texts)  
174kb of js file!!!

With that plugin I think it could be shrinked at 20/30 kb size with  
ease…

---

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 6, 2007, 1:21pm UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/4 "2007-11-06T13:21:51Z")

</div>

Andrea F. wrote:

> I usually create a radiant page called javascripts that loops through  
> its children…each children it’s a js page…then from my layout a  
> call only one js file (/javascripts) that contains all my js code. It  
> should be cool to add a new Filter that use jsminifier to compress all  
> the code…what do you think?
> 
> * * *

Not sure about it but would it not make sense to push the JS and CSS out  
to a file? Or create a bundle into public or compress it all and then  
put it into public?

Or am I missing something here? Of course, this requires that you have  
access to public rather just through the admin. (but then page  
attachments could help there).

Cheers,  
Mohit.  
11/6/2007 | 8:18 PM.

---

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 6, 2007, 2:24pm UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/5 "2007-11-06T14:24:52Z")

</div>

Mohit S. wrote:

> Andrea F. wrote:
> 
> > I usually create a radiant page called javascripts that loops through  
> > its children…each children it’s a js page…then from my layout a  
> > call only one js file (/javascripts) that contains all my js code. It  
> > should be cool to add a new Filter that use jsminifier to compress all  
> > the code…what do you think?
> > 
> > * * *
> 
> Not sure about it but would it not make sense to push the JS and CSS out  
> to a file? Or create a bundle into public or compress it all and then  
> put it into public?
> 
> Or am I missing something here? Of course, this requires that you have  
> access to public rather just through the admin. (but then page  
> attachments could help there).
> 
> Cheers,  
> Mohit.  
> 11/6/2007 | 8:18 PM.

It depends… Franz’s solution is good if you manage the site yourself  
only… you can change all the site through admin, without ftp or  
anything else.

My solution it’s safer when different peoples can access the admin  
interface.

But… now… we are OT…  
😃

---

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 6, 2007, 1:34pm UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/6 "2007-11-06T13:34:47Z")

</div>

> Normally I take js & css as separated static file. I use radiant as cms  
> for my clients… and so I prefer to leave basic layout css and js file  
> not editable. 😃

Yes, if it is for your clients its better to use normal javascript file  
🙂

---

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 7, 2007, 12:45am UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/7 "2007-11-07T00:45:56Z")

</div>

> jsminifier is only a small compressing “utility”… it clear  
> spacing and  
> unusefull chars only. The real plus about using the plugin  
> I’ve posted  
> before is that it gzip files on the fly! 😃

If you have your javascript in a static file, your webserver  
should be doing the compressing with gzip on the fly if it is  
configured correctly. The doco you linked explicitely states  
that the pluging DOESN’T provide compression, only compaction,  
and the it relies on mod\_deflate for compression. Your apache  
server is not currently configured with mod\_deflate.

All pages served through the radiant should also be gzipped  
on the fly when your webserver is correctly configured.

But back to your original question - there’s no reason why  
that plugin couldn’t work in theory - if you dig into your  
logs and look at the real error behind the 500 app error,  
you should be able to get it running.

Dan.

---

<div class="post-metadata">

**Author:** ![sgabello](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@sgabello](https://www.ruby-forum.com/u/sgabello)\
**Post date:** [November 7, 2007, 11:27pm UTC](https://www.ruby-forum.com/t/can-i-use-standard-rails-plugin/119358/8 "2007-11-07T23:27:37Z")

</div>

Daniel S. wrote:

> If you have your javascript in a static file, your webserver  
> should be doing the compressing with gzip on the fly if it is  
> configured correctly. The doco you linked explicitely states  
> that the pluging DOESN’T provide compression, only compaction,  
> and the it relies on mod\_deflate for compression. Your apache  
> server is not currently configured with mod\_deflate.
> 
> Dan.

My actual hoster (hostingrails) doesn’t support mod\_deflate because it  
has high impact on server’s performance…
