I want to add a datepicker to my HAML markup. I started with that question and tried 2 approaches to add an script:
%h3
Please enter the following information:
= form('/some_path', :post)
= input(:date, :start_date, class: "formbox")
= input(:date, :end_date, class: "formbox")
= submit('Submit', class: "button")
%script(type="text/javascript")
$(function() {$( "#start_date, #end_date" ).datepicker({format: 'yyyy-mm-dd'});});
and
:javascript
$(function() {
$( "#start_date, #end_date" ).datepicker({format: 'yyyy-mm-dd'});
});
This one was finally correct, problem was in form part.
Both produce an error syntax error, unexpected keyword_ensure, expecting end-of-input on line :javascript or %script(type="text/javascript")
How to fix that and add the script?