slim-lang-loader
slim-lang-loader copied to clipboard
Pass arguments to partial
When loaded in JS, is there any way you can pass variables to the partial? This is needed if you have some conditional rendering within the partial, e.g.:
.PCard__expand
- if label
.PCard__label = label
I guess maybe there's a slimrb compiler that works in the browser that could be used...
however without that, I don't know how it could be done .... currently the slim is compiled server-side before the website is served ... and since we cannot pass variables in require calls (webpack requires them to be 'statically analyzable') I'm not sure how we would pass that info over to webpack.