module Locomotive module Steam module Middlewares class WysihtmlCss def initialize(app, opts = {}) @app = app end def call(env) status, headers, response = @app.call(env) if content?(env['steam.page'], response) url = ::ActionController::Base.helpers.stylesheet_path('locomotive/wysihtml5_editor') html = %() response.first.gsub!('', %(#{html})) end [status, headers, response] end protected def content?(page, response) page && !page.redirect && page.response_type == 'text/html' && response.first end end end end end