Am using jquery ui datepicker for select date in my rails app. When I give javascript and stylesheet link reference directly in view page, datepicker was working. When i give in application.html.erb file its not working..
My application.js
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require bootstrap
//= require bootstrap-datepicker
My application.css
*= require jquery-ui-1.8.21.custom.css
*= require mystyle.css
My application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Application</title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<%= javascript_include_tag "highcharts", "chartkick" %>
<%= csrf_meta_tags %>
</head>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
View:
Entrydate<input type="text" id="datepicker">
You're confusing it with Bootstrap datepicker. Keep to jQuery UI DatePicker by following the gem docu at https://github.com/joliss/jquery-ui-rails
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.