I have a bookmarklet that can be downloaded on any website.
It works as follows:
- downloads
http://my.example.com/assets/bookmarklet.js
- includes
http://my.example.com/assets/bookmarklet.css
The css file is added to dom via bookmarklet.js
, so it needs to know where it is.
My code is as follows:
// assets/javascripts/bookmarklet.js.erb var config = { stylesheetUrl: '<%= asset_path("bookmarklet.css", :only_path => false) %>' }
But no matter what I'm trying to do, it looks like
var config = { stylesheetUrl: '/assets/bookmarklet.css' }
I need asset_path
to return the full url. But asset_url
does not exist, and I cannot find a variant of asset_path
that will add the current domain.
Any solution?
source share