Here is what I have in my view:
<%= javascript_include_tag "social_sharing.erb" %>
Then I have: assets/javascripts/social_sharing.erb.js which includes some ERB tags like <%= post.id %> ...
The first problem is I see this error message:
`Asset filtered out and will not be served: add `Rails.application.config.assets.precompile += %w( social_sharing.erb.js )` to `config/initializers/assets.rb` and restart your server
If I follow those directions, I then get the js file served, but none of the ERB tags have been evaluated, so I still see <%= post.id %> in the linked js file.
js.erbAnd<%= javascript_include_tag "social_sharing" %>is enough.