0

我一直在切换我的 css 样式,并设法以某种方式弄乱了与 js 文件的链接。

控制台说

GET http://0.0.0.0:3000/assets/js/bootstrap.js 404 (Not Found)

但我不确定应用程序中的哪个位置或如何解决它

我在 application.html.erb 是

<%= stylesheet_link_tag "application", :media => "all" %>
    <%= javascript_include_tag "application" %>
    <%= analytics_init if Rails.env.production? %>

     <%= csrf_meta_tags %>
    <script type="text/javascript">
            function clearDefault(el) {
                if (el.defaultValue==el.value) el.value = ""
            }

            function clearText(){
            search = $('.search-query');
            if (search.defaultValue==search.value)
            search.value = ""
            }

            $(document).ready(function() {
                $('.collapse').collapse();
            });
        </script>
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
      </script>
    <![endif]-->
    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">

        <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-38571594-1']);
  _gaq.push(['_setDomainName', 'guidelinesforme.com']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

我的 application.js 是

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .

$(".collapse").collapse()
4

2 回答 2

0

看看 app/assets/application.js 下面的行还在吗?

//= require_tree .

或者您是否从 app/assets/javascripts 中删除了 bootstrap.js 文件?

于 2013-05-08T11:33:02.093 回答
0

我已经解决了这个问题 - 我不得不更换 require_tree 。需要引导

于 2013-05-08T11:38:52.710 回答