Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7620 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Allow send_file/send_data to use a registered mime type as the :type parameter

Reported by: jonathan Assigned to: core
Priority: normal Milestone: 1.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

The send_data and send_file methods accept a :type option for specifying the content type of the data being sent.

To use a registered my type you have to call the .to_s method on the mime type before sending it in to the :type option like this:

send_data image.data, :type => Mime::PNG.to_s, :disposition => 'inline'

It'd be nice to not have to call the .to_s method before sending it in and this patch allows that.

send_data image.data, :type => Mime::PNG, :disposition => 'inline'

Attachments

allow_use_of_mime_types_with_send_file_and_send_data.diff (1.7 kB) - added by jonathan on 02/21/07 18:02:11.
Patch with tests that allows registered mime types to be passed in as the :type option

Change History

02/21/07 18:02:11 changed by jonathan

  • attachment allow_use_of_mime_types_with_send_file_and_send_data.diff added.

Patch with tests that allows registered mime types to be passed in as the :type option

02/25/07 20:17:11 changed by david

  • status changed from new to closed.
  • resolution set to fixed.

Closed by [6233]