I am trying to render a collection this way

**views/consumer/home/index.html.erb**

```
<%= render @promotions %>

```

**consumer/promotions/\_promotion.html.erb**

```
<% content_for :page_js_modules do %>
  <%= javascript_include_tag 'consumer/carousels'  %>
<% end %>

```

Since \_promotion.html.erb is rendered more than once if there are more than one promotions in @promotions, the javascript tag also gets included more than once and causing issues.

I want to put the javascript tag inside of promotion view only so as to make it modular and hence anyone can use it without worrying about including the pertaining js tags.