Created: 2008-07-03 00:23
Updated: 2016-05-08 10:19
License: mit



Javascripter is a Rails plugin that helps keep your javascript files organized.


This plugin is no longer supported (mainly because I'm no longer actively using it). It should run well in Rails 2.3.X, but may not be compatible with Rails 3. If you're interested in taking over this project, please let me know. Alternately, if you have useful patches, send me a pull request and I will apply them -- but, otherwise, I have no personal plans for future development on this plugin.


To install, just add Javascripter to your vendor/plugins directory:

script/plugin install git://


To use Javascripter, replace your javascript_include_tags with a single tag:

<%= javascripts %>

Once you do, your javascripts will be included automatically, using the conventions below.

<script src="" />

Organize your javascripts

Javascripter uses a simple set of conventions:

  • Javascript for your entire application should be stored in application.js
  • Javascript for specific controllers should be stored in controller.js
  • Javascript for specific actions should be stored in controller_action.js
  • Javascript for specific actions should be stored in controller/action.js (optional)

Follow these conventions and Javascripter will reward you with automagic goodness, loading javascripts for specific controllers or actions whenever they are active.

Support for :defaults

Need Prototype? Just use the :defaults parameter, like normal.

<%= javascripts :defaults %>

Include additional javascripts

Need to include extra javascript libraries? Use the :include parameter:

<%= javascripts :include => "lowpro" %>
<%= javascripts :include => ["lowpro", "lightbox"] %>


Javascripter also includes a generator that will create a default application.js script and separate javascript files for each controller in your application.

To use the generator, run this command in your terminal:

script/generate javascripts

If you add a new controller, just run the generator again and a new javascript for the controller will be created. (Existing javascripts will be ignored.)


Special thanks to Lachie Cox and the rest of my RORO Sydney comrades who asked for this plugin.


Comments and patches welcome at

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more