content_for head 标签不起作用(ruby on rails)

owl*_*owl 3 ruby ruby-on-rails

<% content_for :head do %>
  <%= javascript_include_tag "http://code.jquery.com/jquery-latest.min.js" %>
<% end %>
Run Code Online (Sandbox Code Playgroud)

它不起作用。

如何将html插入到head标签中?

谢谢。

Ahm*_*rif 6

<%= yield :head %>你的<head>标签里面有吗(可能在你的 layouts/application.html.erb 中)?不?然后添加它:)。