Using Erb With Handlebars Templates
I have a modal that makes new tags with ajax. It does a POST method with the Tags parameters without recharging the view. So I want, depending on the 'price_type' parameter chosen,
Solution 1:
You need to name your file something with .hbs.erb
at the end of it, rather than simply .hbs
.
This will encourage Rails to compile the file first as an .erb
file (injecting erb
data into the .hbs
file), then Rails will render the file as a .hbs
(Rails compiles files in the order of file extensions from right to left).
Post a Comment for "Using Erb With Handlebars Templates"