Why not just something like this? Then you can put your dojo.js in 
assets/javascripts and compile it like normal. Seems kind of unnecessary to 
add extra logic to javascript_include_tag

<%= javascript_include_tag 
"http://ajax.googleapis.com/ajax/libs/dojo/1.6.1/dojo/dojo.xd.js"; %>
<script type="text/javascript">
  if ( typeof(dojo) === "undefined" ) { 
    script = document.createElement('script');
    script.type = "text/javascript";
script.src = '<%= asset_path "dojo.js" %>';
document.getElementsByTagName('head')[0].appendChild(script);
  }
</script>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/uLhgXEinLwoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to