Skip to content

allow Rails app to load an external webpage into Rack, the better to further mess with it

Notifications You must be signed in to change notification settings

houhoulis/rack-uri-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.)

About

allow Rails app to load an external webpage into Rack, the better to further mess with it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published