I`m looking to create something similar to the Digg/Stumbleupon bar that is fixed to the top of a newly opened page.
In my application I display a bunch of links to
You'll have to point your links to a Rails action, passing the external URL as a parameter.
So instead of:
= link_to "http://rubyonrails.org/"
# => <a href="http://rubyonrails.org/">
You would link to:
= link_to open_url_path, url: "http://rubyonrails.org/"
# => <a href="/open_url?url=http%3A%2F%2Frubyonrails.org%2F">
Then you can pass the url from your controller to the view:
def open_url
@url = params[:url]
end
And render the HTML containing your toolbar and iframe:
<div id="toolbar" />
<iframe src="<%= @url %>" />