def define_class_action(action, &block)
      body = block_given? ? block : ClassTemplateMethods.instance_method(action)
      define_singleton_method(action, body)
      singleton_class.send(:alias_method, :all, :index) if action == :index
      singleton_class.send(:alias_method, :find, :show) if action == :show
    end
def define_class_action(action, &block)
      body = block_given? ? block : ClassTemplateMethods.instance_method(action)
      define_singleton_method(action, body)
      singleton_class.send(:alias_method, :all, :index) if action == :index
      singleton_class.send(:alias_method, :find, :show) if action == :show
    end
Define a class-level action on the current class. See {define_action}.