Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7815939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:41:04+00:00 2026-06-02T05:41:04+00:00

I have a bookmarklet that can be loaded on any website. It works like

  • 0

I have a bookmarklet that can be loaded on any website.

It works like this;

  • loads http://my.example.com/assets/bookmarklet.js
  • includes http://my.example.com/assets/bookmarklet.css

The css file is added to the dom via bookmarklet.js, so it needs to know where this 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 try this renders as

var config = {
  stylesheetUrl: '/assets/bookmarklet.css'
}

I need the asset_path to return a full url.
But asset_url doesn’t exist, and I can’t find an option to asset_path that will prepend the current domain.

Any solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:41:08+00:00Added an answer on June 2, 2026 at 5:41 am

    You need to set an explicit asset host for each environment. For example:

    # development.rb
    config.action_controller.asset_host = "http://localhost:3000"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm making a bookmarklet to my website, and for now i have: <a href=javascript:location.href='http://website.com/compartir_link.php?url='+encodeURIComponent(location.href)
I have a bookmarklet that inserts a widget into any site's pages. The styling
I have come across Evernote's bookmarklet and was wondering how this worked. You can
I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data,
i have this js bookmarklet that makes all the current page's font colors black.
I have a bookmarklet that loads a div into a current page and places
I have a bookmarklet that I've made and it loads a script from my
Suppose you have an old legacy website, with an in-house php CMS. http://mysite.com/index.php?page=3&c=7 Now,
I have a bookmarklet that will come up with a iframe that will load
I have a pretty typical bookmarklet code that's working perfectly for me in all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.