Open waynebontrager opened 9 years ago
Hello, @waynebontrager You can send me PR for README fixes about this issue in docs :)
Is it possible to pass variables to the partials?
Also, there is no way to use partials inside the templates without passing them in the render partials
option?
I was running into issues where the handlebars partials inside of a handlebars template was not able to find the files when rendering the template from Rails but it was working when using Javascript. I found from an example site (github: https://github.com/le0pard/st_rails_example, website: http://st-rails-example.herokuapp.com/) that this was the format I should be using:
<%= render "sht/product", handlebars: product_for_template(product), partials: {product_description: (render "sht/product_description")} %>
I didn't know partials was an option that could be passed so I thought it may be helpful for someone in the future to add this to the documentation somewhere.