Changeset 1117

Show
Ignore:
Timestamp:
07/30/07 12:53:50 (1 year ago)
Author:
alban
Message:

[Bug 156] redirection vers /static/cast/

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/casts_controller.rb

    r1002 r1117  
    4545                        type = "application/mp3" 
    4646        end 
    47         send_file @cast.path(format), :type => type, :filename => "audiobank-#{@cast.name}.#{format}", :disposition => "inline
     47        redirect_to "/static/cast/#{@cast.filename(format)}
    4848  end 
    4949 
  • trunk/app/models/cast.rb

    r794 r1117  
    1616 
    1717        def path(format = "ogg") 
    18                 "#{RAILS_ROOT}/media/cast/#{id}.#{format}" 
     18          "#{RAILS_ROOT}/media/cast/#{filename(format)}" 
     19        end 
     20         
     21        def filename(format = "ogg") 
     22          "#{id}.#{format}" 
    1923        end 
    2024         
     
    4852                                end 
    4953                        end 
    50                 end             
     54                end 
    5155        end 
    5256end