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 6769397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:11:20+00:00 2026-05-26T15:11:20+00:00

I want to create link_to google like in Rails. Let me explain. On simple

  • 0

I want to create link_to “google like” in Rails.

Let me explain.

On simple google search page
http://www.google.com/search?hl=en&source=hp&biw=1280&bih=658&q=stackoverflow&oq=stackoverflow&aq=f&aqi=g10&aql=1&gs_sm=e&gs_upl=65l2231l0l2364l13l13l0l5l5l1l297l1698l1.2.5l8l0

Everything looks beatiful to simple user.

URL preview is stackoverflow.com

But when I click copy link location I get this address http://www.google.com/url?sa=t&rct=j&q=stackoverflow&source=web&cd=1&ved=0CC8QFjAA&url=http%3A%2F%2Fstackoverflow.com%2F&ei=JVOpTra5M-Pi4QT1pPwk&usg=AFQjCNERidL9Hb6OvGW93_Y6MRj3aTdMVA&sig2=_ARyobDs5AzfZw4YwBNg1g

How to control URL preview with JS or Coffescript in Rails for link_to? Can somebody provide some solution to this problem?

  • 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-05-26T15:11:21+00:00Added an answer on May 26, 2026 at 3:11 pm

    The original link reference is the “pretty version” but a mousedown event changes the URL to redirect through Google’s site using JavaScript.

    Original HTML:

    <a class="l" onmousedown="return rwt(this,'','','','1','AFQjCNERidL9Hb6OvGW93_Y6MRj3aTdMVA','','0CDAQFjAA')" href="http://stackoverflow.com/">
    

    Stack Overflow

    After a mousedown event (even right clicking):

    <a class="l" onmousedown="return rwt(this,'','','','1','AFQjCNERidL9Hb6OvGW93_Y6MRj3aTdMVA','','0CDAQFjAA')" href="http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDAQFjAA&url=http%3A%2F%2Fstackoverflow.com%2F&ei=aVepTtjwJ4nlsQKTvLHbBQ&usg=AFQjCNERidL9Hb6OvGW93_Y6MRj3aTdMVA">
    

    Stack Overflow

    An untested JQuery implementation for an ERB based template:

    $('.l').mousedown(function() {
      $(this).attr("href","<%= url_for(:controller => :redirect, :action => :index) -%>/"+$(this).attr("href"));
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create an FAQ page like the one on this website http://www.microsoft.com/windows/windows-7/faq.aspx
I want to create a list view custom like this link : http://sites.google.com/site/androideyecontact/_/rsrc/1238086823282/Home/android-eye-contact-lite/eye_contact-list_view_3.png?height=420&width=279 so
I want to create a link like this: <a href=http://example.com>text</a> and replace the behavior
I want to create WatermarkTextBox in WP7.1 I followed the link http://www.windowsphonegeek.com/articles/WP7-WatermarkedTextBox-custom-control But that
I have a link which looks like that: www.domain.com/file.php I want to create .htaccess
When somebody clicks on my google adwords link like this: http://www.myshoppingsite.com/product/rubberball.aspx?promo=promo123 I want my
I want to create link to www.google.com with use < a href = www.google.com
I have an iframe that looks like this: <iframe src=http://www.google.com height=1000 width=500 id=myiframe></iframe> I
Here is the link : http://www.draw2d.org/draw2d/ I want to create flowchart as in the
I have textview which contains urls like www.google.com . for this textview a have

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.