Hello everybody out there,
I'm very frustrated with the jQuery Datepicker and Rails 3.1. It runs perfectly in my develoment environment, but it doesn't work in the production environment on Heroku/Cedar. It simply doesn't pop-up when I select my date field.
So here's what I did so far:
I put the jquery files into \apps\assets\javascript:
- jquery-1.7.1.min.js
- jquery-ui-1.8.17.custom.min.js
- jquery.ui.datepicker-de.js
and I added them among other files to my production.rb:
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) <br />
config.assets.precompile += %w( event_calendar.js event_calendar.css jquery-1.7.1.min.js jquery-ui-1.8.17.custom.min.js jquery-ui-1.8.17.custom.css jquery.ui.datepicker-de.js)
Then I precompiled my assets locally as described here and they appeared correctly in /public/assets/ and in my manifest.yml. So everything looks good and I don't get any errors while pushing my app to Heroku, but when I select my text field associated with the datepicker nothing happens, it simply doesn't show up.
Any ideas what could be wrong here?
How can I find out what the problem is?
In the Heroku Logs I can only find entries like this:
cache: [GET /assets/application-58ec8ec4b5384a8fb8d7884169385e49.css] miss
Would be happy if somebody could help, please.
Update:
Here's my application.js
:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require_tree .
$(document).ready(
function()
{
$("#picker").datepicker($.datepicker.regional['de']);
$("#picker").datepicker();
}
);
As far as I know //= require_tree .
takes care of including all javascript files in the assets folder, like \app\assets\javascripts\
. Does that include precompiled assets in \public\assets
???.
And here's my application.css
:
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/
...
Same here, I thought *= require_tree .
takes care of \app\assets\stylesheets
as well as for \public\assets
, where my precompiled stylesheets are.
Here the link to the app on heroku, selecting the date field should pop-up the calendar:
http://smooth-window-1858.herokuapp.com/events/new