vidur punj
vidur punj

Reputation: 5861

javascript_include_tag not working in rails 2?

The rails tag to include javascript , and for browser caching:

<%= javascript_include_tag '/skin/js/html5.js', :cache => true %>

forget about caching simple javascript_include tag is also not working. Ex:

<%= javascript_include_tag '/skin/js/html5.js', :cache => true %>

But the script tag below is working find stop working after doing this.

<script src="/skin/js/html5.js" type="text/javascript"></script>

using Rails 2 any reason for such a behavior or this tag did not even work in rails2?

Upvotes: 1

Views: 185

Answers (1)

Navin Nair Kottayil
Navin Nair Kottayil

Reputation: 563

Try

First make sure that you are including the tag inside the head

<% content_for :head do %>
  <script src="skin/js/html5.js"></script>
<% end %>

Upvotes: 2

Related Questions