Is there any way to use a Rails helper method, more specifically, a path helper method within a javascript asset file. This file foo.js.coffee.erb
$('#bar').val("<%= create_post_path %>")
I would love it if I could get from erubis
$('#bar').val("path/to/create")
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…