MonoForge

matthuhiggins / googtaculous

googtaculous

Public

Modify javascript_include_tag to use google's Ajax Library Api

10 filesupdated Jun 18, 2026

README

Googtaculous

Modifies how javascript_include_tag works, so that Rails javascript files are served from Google's Ajax Library API. Local javascript is used when ActionController::Base.consider_all_requests_local is true, which is true in development mode.

Example

<%= javascript_include_tag 'prototype', 'effects' %>

Expands to:

<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/effects.js" type="text/javascript"></script>

Additionally,

<%= javascript_include_tag :defaults %>

expands to

<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/effects.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/dragdrop.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/controls.js" type="text/javascript"></script> <script src="/javascripts/application.js?1213130636" type="text/javascript"></script>

Copyright (c) 2008 [Matthew Higgins], released under the MIT license