Permalink
Browse files

Merge pull request #81 from adamcrown/master

Rails 3.1 fixes
  • Loading branch information...
2 parents d0702bc + e9604ec commit 932de435d20f67e40c7b22ffb13fcbdaf76f5f56 Neeraj Singh committed Oct 14, 2011
Showing with 7 additions and 7 deletions.
  1. +6 −6 app/controllers/admin_data/public_controller.rb
  2. +1 −1 app/helpers/admin_data/application_helper.rb
@@ -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
@@ -23,7 +23,7 @@ def get_sort_class(column)
end
def parent_layout(layout)
- @_content_for[:layout] = self.output_buffer
+ content_for(:layout, self.output_buffer)
self.output_buffer = render(:file => "layouts/#{layout}")
end

0 comments on commit 932de43

Please sign in to comment.