I'm upgrading a rails 2.3.9 application and I have a file named widget.js
that lives at /public/javascripts/widget.js
.
Users can embed this javascript widget on their own site like so:
<script src='http://example.com/javascripts/widget.js' type='text/javascript'></script>
<script>
new Widget({user_id: 1234});
</script>
As I understand it, with Rails 3.1 everything under assets/
is fingerprinted in production so widget.js
would have a filename like widget-XXXYYYZZZ.js
and would change every time the file was changed. This means that it wouldn't be possible to give users this embeddable url for the widget.js
file since it'll change.
How can this be accomplished on rails 3.1?