Skip to content

Instantly share code, notes, and snippets.

# Origin of etag_matches? https://github.com/rails/rails/blob/7511f9794df8f803f28306d378f9fefc28165886/actionpack/lib/action_dispatch/http/cache.rb
module ActionController
class Request
alias_method :etag_matches_original?, :etag_matches?
def etag_matches?(etag)
!env['HTTP_USER_AGENT'].include?('MSIE') && etag_matches_original?(etag)
@jaakkos
jaakkos / gist:1239088
Created September 24, 2011 07:48
Dashboard template
Template:
<script id="competition-dashboard-template" type="text/x-handlebars-template">
{{#competitionCompleted this}}
<h1>Done</h1>
{{else}}
<h1>Not Done</h1>
{{/competitionCompleted}}
{{#loginPanel}}
gem "haml", ">= 3.0.12"
gem "factory_girl"
gem "rspec-rails", ">= 2.0.0.beta.15", :group => :test
generators = <<-GENERATORS
config.generators do |g|
g.orm :active_record
g.template_engine :haml
g.test_framework :rspec, :fixture => false, :views => false
g.fixture_replacement :factory_girl
require 'rubygems'
require 'camping'
require 'camping/ar'
require 'camping/session'
require 'redcloth'
require 'xml/mapping'
Camping.goes :CSRFExperiment
module CSRFExperiment