Note that there are some explanatory texts on larger screens.

plurals
  1. PORails: Jquery/Javascript fails to load from correct assets location
    primarykey
    data
    text
    <p>I'm having a problem with my Jquery and Javascript. I've been building an application, using github to work on it between work and at home. At work, everything works fine, all of my Jquery works. When I pull the app at home, the jquery and javascript does not respond. This includes the javascript I'm using from bootstrap.</p> <p>The browsers' javascript console is showing some errors that seem to be the root of the problem but I'm not sure how to go about fixing them.</p> <p>My application layout include this:</p> <pre><code>&lt;head&gt; &lt;link href="css/bootstrap.min.css" rel="stylesheet" media="screen"&gt; &lt;title&gt;Website&lt;/title&gt; &lt;%= javascript_include_tag "application" %&gt; &lt;%= stylesheet_link_tag "application", media: "all" %&gt; &lt;%= csrf_meta_tags %&gt; &lt;/head&gt; ... &lt;body&gt; ... &lt;script src="/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;/body&gt; </code></pre> <p>and my application.js has this:</p> <pre><code>//= require jquery //= require jquery_ujs //= require_tree . //= require bootstrap.min.js </code></pre> <p>What else should I check or try to change?</p> <p>My browser javascript console throws some errors as well:</p> <pre><code>Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/requests/css/bootstrap.min.css Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/requests/js/bootstrap.min.js </code></pre> <p>requests is one of my models. Depending on which mvc I'm currently working with, it will search for the resources in those folders. For example when I try to use the javascript that's in my "ecn" view, I get the following errors:</p> <pre><code>Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/ecns/css/bootstrap.min.css Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/ecns/js/bootstrap.min.js </code></pre> <p>Why would rails be trying to look for the assets in any folder other than the assets folder?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload