Sha256: 6896b7d666e973d7543858728ef0738b8bcfedd17d4b4e30a60f38e3fb50ebd7
Contents?: true
Size: 765 Bytes
Versions: 5
Compression:
Stored size: 765 Bytes
Contents
module Htmltoword class Railtie < ::Rails::Railtie initializer 'htmltoword.setup' do if defined?(Mime) and Mime[:docx].nil? Mime::Type.register 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', :docx end ActionController::Renderers.add :docx do |file_name, options| Htmltoword::Renderer.send_file(self, file_name, options) end if defined? ActionController::Responder ActionController::Responder.class_eval do def to_docx if @default_response @default_response.call(options) else controller.render({ docx: controller.action_name }.merge(options)) end end end end end end end
Version data entries
5 entries across 5 versions & 2 rubygems