Note that there are some explanatory texts on larger screens.

plurals
  1. POUncaught TypeError: Object [object Object] has no method 'datepicker'
    primarykey
    data
    text
    <p>I'm running rails 3 on localhost and was getting the error </p> <pre><code>Uncaught TypeError: Object [object Object] has no method 'datepicker' </code></pre> <p>after following railscasts <a href="http://railscasts.com/episodes/213-calendars" rel="nofollow">http://railscasts.com/episodes/213-calendars</a>, and putting both lines below into my application.html.erb file</p> <pre><code>&lt;%= stylesheet_link_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css", "application" %&gt; &lt;%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js", "application" %&gt; </code></pre> <p>I actually solved this error by downloading jquery-ui.min.js file and putting it in my javascripts project folder, and replacing one of the lines, to the result below :</p> <pre><code>&lt;%= stylesheet_link_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css", "application" %&gt; &lt;%= javascript_include_tag "application" %&gt; </code></pre> <p>I also do not understand why i need to put my datepicker function inside my application.js :</p> <pre><code>$(function() { $('#start_date').datepicker(); $('#end_date').datepicker(); }) </code></pre> <p>and cannot put it on my users.js.coffee file with just the lines :</p> <pre><code>$('#start_date').datepicker(); $('#end_date').datepicker(); </code></pre> <p>Anyone can explain why adding the js file locally solved this error, and why i cannot put my datepicker into my local coffee file, or if i can, can you please tell me how?</p> <p>Thank you</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.
 

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