2013-05-08 2 views
0

Я переключил свои стили CSS, и мне удалось каким-то образом связать связь с js-файлами.ссылка на js-файлы в rails app

Консоль говорит

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> 

и мое применение.js is

// 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() 

ответ

0

посмотреть в app/assets/application.js Ли линия ниже все еще там?

//= require_tree . 

Или вы удалили файл bootstrap.js из приложения/активов/javascripts?

+0

bootstrap.js есть, как и линия, которую вы отправили – tessad

+0

, появляется ли файл по этому адресу? http://0.0.0.0:3000/assets/bootstrap.js – slinky2000

0

Я решил проблему - мне пришлось заменить require_tree. с требованием bootstrap