Skip to content

Instantly share code, notes, and snippets.

class Event
include MongoMapper::Document
include MultiParameterAttributes
key :name, String, :required => true
key :start_date, Date, :required => true
key :start_time, Time, :required => true
end
class SongsController < ApplicationController
def index
@songs = Song.all(:destroyed_at => nil)
@totals = load_totals(@songs)
end
def new
@song = Song.new
render :layout => false
class Song
include MongoMapper::Document
plugin Grip
attachment :mp3
key :title, String
key :artist, String
key :album, String
key :genre, String