owl
owl

Reputation: 4461

content_for head tag doesn't work (ruby on rails)

<% content_for :head do %>
  <%= javascript_include_tag "http://code.jquery.com/jquery-latest.min.js" %>
<% end %>

It doesn't work.

How to insert html into head tag?

Thanks.

Upvotes: 5

Views: 2177

Answers (1)

Ahmad Sherif
Ahmad Sherif

Reputation: 6213

Do you have <%= yield :head %> inside your <head> tag (probably in your layouts/application.html.erb)? No? Then add it :).

Upvotes: 10

Related Questions