Created
August 10, 2011 22:11
-
-
Save spovich/1138415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fix for Zippy template handler loading | |
# Make template handler compatible with Rails 3.0.x and 3.1+ | |
# Original https://github.com/toretore/zippy/blob/master/rails/init.rb | |
require 'zippy' | |
Mime::Type.register 'application/zip', :zip | |
module ActionView | |
module Template::Handlers | |
class Zipper | |
def self.call(template) | |
new.compile(template) | |
end | |
def compile(template) | |
"Zippy.new { |zip| #{(template.respond_to?(:source) ? template.source : template)} }.data" | |
end | |
end | |
end | |
Template.register_template_handler :zipper, Template::Handlers::Zipper | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment