Resource On Demand plugin

Plugin details

Allows inclusion of external javascript and stylesheets in the head tag, from anywhere in a view, including nested partials

Repositoryhttp://svn.devjavu.com/liquid/resource_on_demand/ Tags resource LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.devjavu.com/liquid/resource_on_demand/

Usage
============

Within the head tag of the layout

  <%= resource_on_demand %>


Then from anywhere in you views or partials

  <% require_javascript "my", "javascript", "files", :defaults %>


(Note: ues <%; do not use <%=.)

This will add the specified javascripts to the head tag. The arguments are the same as used in javascript_include_tag.

require_stylesheet is similar, but the arguments are the same as used in stylesheet_link_tag

  <% require_stylesheet "my", "stylesheet", :media => 'print' %>

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, about 1 year ago