Skip to content

Instantly share code, notes, and snippets.

@icegulch
icegulch / action.rb
Last active December 20, 2015 19:09 — forked from ahoward/action.rb
# it's not critical for understanding
# but here is the associated server-side action
#
def version
@program = load_program!
@version = @program.versions.find(params[:version_id])
if stale?(:last_modified => @version.updated_at, :etag => @version.cache_key)
#! /usr/bin/env ruby
# this is best practice for writing mixins. the deferred evaluation is more
# powerful that the approach of ClassMethods/InstanceMethods as modules too
#
module Mixin
# put your class level code in here
#
ClassMethods = proc do