1 2 3 4 5 6 7 8 9
require "base64" module Base64Filter def base64_encode (input) Base64.strict_encode64(input).tr('+/', '-_') end end Liquid::Template.register_filter(Base64Filter)