Jquery ui datepicker style not showing up in Rails 5.1 application in production

I just deployed a Rails 5.1 application to a production server. Everything works fine, except that the CSS styles for the jQuery UI datepicker are not displayed. When you click on a date field in the form, an empty calendar is displayed. Other CSS styles are displayed.

I need a library in the app / assets / javascripts / application.js file:

//= require jquery-ui/datepicker

I also imported css styles in the app / assets / stylesheets / application.scss file:

@import 'jquery-ui/datepicker.css';

The Datepicker works great in development, however, when I test Google Developer tools in production, it seems that the datepicker.css request gets a status of 404. I don’t know why this is. Maybe I should install some additional materials on the production server?

any advice or help is appreciated,

Anthony

+4
source share
1 answer

I fixed the problem by adding

/*
*= require jquery-ui
*/

to the top of the app / assets / stylesheets / application.scss file.

0
source

Source: https://habr.com/ru/post/1687724/


All Articles