Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery is not loading, how jquery-rails works
    text
    copied!<p>I am learning jquery &amp; ajax via railscasts<a href="http://railscasts.com/episodes/136-jquery-ajax-revised" rel="nofollow noreferrer">136 revise jquery &amp; ajax</a>. I spent more than 4 hours still can not make the first step work. </p> <p>The problem is I add <code>remote: true</code> as data attribute and <code>new.js.erb</code> under <code>app/view/task</code>. However, It never triggers the ajax call. It just redirects to the new page. </p> <p>Since It just really simple. I create public repo. <a href="https://github.com/nyrails/jquery_ajax" rel="nofollow noreferrer">here</a> </p> <p>Then, after several hours research, I found the jQuery is not been loaded. Because, I added</p> <pre><code>debugger if (jQuery) { alert('Jquery is loaded') } else { alert ('Jquery is not loaded') } </code></pre> <p>You can also find that in the github repo. I also read <a href="https://stackoverflow.com/questions/13193905/jquery-not-working-on-rails-3-2-8">this topic</a>, and also tried to switch the <code>ujs</code> and <code>jquery</code> </p> <pre><code>//= require jquery //= require jquery_ujs //= require_tree . </code></pre> <p>or <code>css</code> and <code>js</code>. </p> <pre><code>&lt;%= stylesheet_link_tag "application", :media =&gt; "all" %&gt; &lt;%= javascript_include_tag "application" %&gt; </code></pre> <p>to:</p> <pre><code>&lt;%= javascript_include_tag "application" %&gt; &lt;%= stylesheet_link_tag "application", :media =&gt; "all" %&gt; </code></pre> <p>nothing works. </p> <ol> <li><p>I want to know, how jquery-rails works. Why there is no error and it just can not load jQuery?</p></li> <li><p>I tried to upgrade rails version 3.2.8 to 3.2.15, which turn out to work. Still would like to know the reason.</p></li> </ol> <p>Wired issue, Would like to figure out the reason. Thanks</p>
 

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