fixes raw view for text files with code like *.rb

This commit is contained in:
Dmitriy Zaporozhets 2012-01-25 09:15:08 +02:00
parent ec1a426726
commit 4647c6fa3a

View file

@ -37,7 +37,12 @@ class RefsController < ApplicationController
def blob def blob
if @tree.is_blob? if @tree.is_blob?
send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name) send_data(
@tree.data,
:type => @tree.text? ? "text/plain" : @tree.mime_type,
:disposition => 'inline',
:filename => @tree.name
)
else else
head(404) head(404)
end end