Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Allow use of symbols for :type option of ActionController::Streaming#send_file/#send_data

#1232

Attached patch adds support for symbols for :type options of send_file and send_data. Instead of this:

@@@ruby send_file("/foo/bar/whatever.png", :type => "image/png")



you can now do this:

@@@ruby
send_file("/foo/bar/whatever.png", :type => :png)

You can use whatever symbol registered through Mime::Type.register. Test is included.

Reported by Adam Cigánek · October 17th, 2008 @ 09:55 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Adam Cigánek
    Adam Cigánek

    Sorry, the formatting got screwed up:

    
    send_file("/foo/bar/whatever.png", :type => "image/png")
    

    you can now do this:

    
    send_file("/foo/bar/whatever.png", :type => :png)
    

    October 17th, 2008 @ 09:58 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [fcd58dc27a99085b161f2463988d4ee373d44ec6]) Allow use of symbols for :type option of ActionController::Streaming#send_file/#send_data [#1232 Allow use of symbols for :type option of ActionController::Streaming#send_fil... state:resolved]

    Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...

    December 21st, 2008 @ 07:05 PM