Skip to content

Commit

Permalink
Fixing Rails 3.1 compatability for public#serve
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcrown committed Sep 12, 2011
1 parent 0b72c44 commit 375b787
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/controllers/admin_data/public_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ def serve
render :nothing => true, :status => 404 and return
end

case params[:file]
when /\.css$/i
case params[:format].to_s.downcase
when 'css'
content_type = "text/css"
when /\.js$/i
when 'js'
content_type = "text/javascript"
when /\.png$/i
when 'png'
content_type = "image/png"
when /\.jpg$/i
when 'jpg'
content_type = "image/jpg"
else
render :nothing => true, :status => 404 and return
end

render({:text => File.read(path), :cache => true, :content_type => content_type})
render({:text => File.read("#{path}.#{params[:format]}"), :cache => true, :content_type => content_type})
end

end
Expand Down

0 comments on commit 375b787

Please sign in to comment.