allow Rails app to load an external webpage into Rack, the better to further mess with it
Ruby JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
testrailsapp
.gitignore
README
TODO.txt

README

This Rack middleware (rack-uri-loader.rb) is intended to serve an
external Web resource as though it were local, allowing further
transmogrification.

If you set your rails app to serve a view as text rather than as html,

  render :text => "http://www.yahoo.com", :content_type => "text/plain"

then this middleware assumes you are giving it a URL.  The middleware fetches
the URL and serves up the resource in that view of your application.

(techiferous's rack-plastic, http://github.com/techiferous/rack-plastic,
is a complementary middleware which you could use to facilitate further
Nokogiri manipulation of the page to be rendered.  It was part of the
inspiration for this middleware.)