Render JS from partials, at the bottom of the master layout?

I’ve got small snippets of JS in partials
Is there a way for these to be parsed and rendered at the bottom of the layout?

(as is often recommended https://stackoverflow.com/questions/1638670/javascript-at-bottom-top-of-web-page)

It depends on which template you are referring, but it ought to work by loading a partial at the bottom of the template. I didn’t follow the link, presuming that’s what you mean.

What have you done so far?

At the moment I just have separate <script> tags in multiple partials.

So when the page is rendered, it’s got multiple script tags. In Rails, I’d used <%= yield %> tags to aggregate JS from partials into one block in the containing parent layout.

Please read the requesting help post and share more information, someone will be able to assist. :slight_smile:

1 Like