Sha256: 9455738209b1091b9f4a158d2b293367d0a2245f77e45f5f0df452268cec2ac6
Contents?: true
Size: 549 Bytes
Versions: 2
Compression:
Stored size: 549 Bytes
Contents
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'rack-plastic') require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'plastic_helper') # This middleware demonstrates how to add inline CSS styles to the web page. # module Rack class Stylizer < Plastic def change_nokogiri_doc(doc) doc.at_css("body")["style"] = "font-family: Georgia, serif; font-style: italic;" doc.at_css("div#container")["style"] = "margin-left:auto;margin-right:auto;width:500px;position:relative" doc end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rack-plastic-0.0.2 | test/middlewares/stylizer.rb |
rack-plastic-0.0.1 | test/middlewares/stylizer.rb |