Skip to content

Instantly share code, notes, and snippets.

View DCarper's full-sized avatar

Dan Carper DCarper

View GitHub Profile
@DCarper
DCarper / haml.html
Created October 6, 2011 15:41 — forked from carols10cents/haml.html
Haml vs html -- can have "display: inline" tags inline?
<!-- haml -->
%blockquote
I am not running for president. -
%strong
everyone
, ever
<!-- html -->
class Album < ActiveRecord::Base
attr_accessible :title
has_one :artist , :dependent => :destroy
has_many :genres , :dependent => :destroy
accepts_nested_attributes_for :artist, :allow_destroy => true
end
@DCarper
DCarper / ??.rb
Created January 18, 2011 20:01 — forked from esparkman/gist:785031
def new
@company = Company.find(params[:id])
@ticket = Ticket.new(:app => @ticket)
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @company }
end
end
def to_key
new_record? ? nil : [ self.send(self.class.primary_key) ]
end
def persisted?
false
end