<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Requiring javascript and CSS in Rails without directly injecting code into the HEAD element'</title>
    <description>Snipplr comments feed</description>
    <link>https://ipv6.snipplr.com/</link>
    <lastBuildDate>Tue, 21 Apr 2026 22:10:25 +0000</lastBuildDate>
    <item>
      <title>sgtrock said on 27/Dec/2009</title>
      <link>https://ipv6.snipplr.com/view/25493/requiring-javascript-and-css-in-rails-without-directly-injecting-code-into-the-head-element</link>
      <description>&lt;p&gt;I also use this technique to implement Google Maps in the view using the YM4R plugin. Much more declarative than forcing a way to inject the GMap header stuff into the HEAD in a jumble with everything else.&#13;
&#13;
In application_helper.rb:&#13;
&#13;
  def requires_google_maps&#13;
    content_for :page_dependencies do&#13;
      concat GMap.header&#13;
    end&#13;
  end&lt;/p&gt;</description>
      <pubDate>Sun, 27 Dec 2009 00:39:18 UTC</pubDate>
      <guid>https://ipv6.snipplr.com/view/25493/requiring-javascript-and-css-in-rails-without-directly-injecting-code-into-the-head-element</guid>
    </item>
    <item>
      <title>sgtrock said on 27/Dec/2009</title>
      <link>https://ipv6.snipplr.com/view/25493/requiring-javascript-and-css-in-rails-without-directly-injecting-code-into-the-head-element</link>
      <description>&lt;p&gt;Trying the code again with markdown...&#13;
&#13;
    def requires_google_maps&#13;
      content_for :page_dependencies do&#13;
        concat GMap.header&#13;
      end&#13;
  end&lt;/p&gt;</description>
      <pubDate>Sun, 27 Dec 2009 00:40:09 UTC</pubDate>
      <guid>https://ipv6.snipplr.com/view/25493/requiring-javascript-and-css-in-rails-without-directly-injecting-code-into-the-head-element</guid>
    </item>
  </channel>
</rss>
