Skip to content

Commit

Permalink
Merge pull request #81 from adamcrown/master
Browse files Browse the repository at this point in the history
Rails 3.1 fixes
  • Loading branch information
Neeraj Singh committed Oct 14, 2011
2 parents d0702bc + e9604ec commit 932de43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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
2 changes: 1 addition & 1 deletion app/helpers/admin_data/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 932de43

Please sign in to comment.