Answer the question
In order to leave comments, you need to log in
How to access an image from application.js (Rails)?
Hello, there is such code in application.js
$(function() {
$('.datepicker').datepicker({
dateFormat: 'yy-mm-dd',
showOn: "button",
buttonImage: 'app/assets/images/calendar.png',
buttonImageOnly: true,
buttonText: "Select date"
});
});
Answer the question
In order to leave comments, you need to log in
Rename the file to apllication.js.erb and use
guides.rubyonrails.org/asset_pipeline.html#javascr...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question