I have a file app/assets/javascripts/calendar/weekplans.js.erb
, which contains some basic erb:
var init_weekplans = function() {
//..
allDayText: '<%= t('weekplan.all-day') %>'
//..
}
Rails fails on (pre)compiling this asset with undefined method 't'
. I'd like to use the t()
method from ActionView::Helpers::TranslationHelper in there. How do I include this? Is it wise to include this at all, or should I simply push any such variable from the controller or view into this init_weekplans
function, instead?