Sha256: 5e84796d53f3db6e3efcef6058e6cc9b06c3a44fc1c4ebdc8ef0e1805822fc8d
Contents?: true
Size: 471 Bytes
Versions: 5
Compression:
Stored size: 471 Bytes
Contents
ActiveModel::Exporter::TYPES.each do |type| ActionController::Renderers.add type do |resource, options| method = "to_#{type}".to_sym if resource.respond_to?(method) encode = options[:encode] || 'iso-8859-1' mtype = Mime[type.to_sym] file = resource.send(method).encode(encode) default_options = {type: mtype, disposition: 'attachment'} send_data(file, default_options.merge(options)) else resource end end end
Version data entries
5 entries across 5 versions & 1 rubygems