I am trying to implement a datepicker in my rails view.
My view is :-
<%= f.label :start_date %>
<%= f.text_field :start_date,:id => "season_start_date" %>
My application.html.erb :-
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js",
"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js","application" %>
And my application.js file looks like this:-
$(document).ready(function(ev){
$("#season_start_date").click(function(){
$('#season_start_date').datepicker();
});
});
And my gem file:-
gem "jquery_datepicker"
gem 'jquery-rails'
Thank you
This error was resolved when i removed all the javascript include tag contents except application.
I guess because of the multiple js files it was getting confused and hence was throwing error no method ‘datepicker.’