Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #81 from adamcrown/master

Rails 3.1 fixes
  • Loading branch information...
commit 932de435d20f67e40c7b22ffb13fcbdaf76f5f56 2 parents d0702bc + e9604ec
@neerajdotname neerajdotname authored
View
12 app/controllers/admin_data/public_controller.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
View
2  app/helpers/admin_data/application_helper.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.