Skip to content

Instantly share code, notes, and snippets.

View DCarper's full-sized avatar

Dan Carper DCarper

View GitHub Profile
- form_for [@bracket, @bracket.guess_for(user)], :html => {:method => :delete, :class => 'destroy_guess'} do |f|
= f.submit "Delete Guess"
@DCarper
DCarper / attributes
Created February 8, 2011 19:23
trying to make git-diff and git-difftool ignore binary files
# .git/info/attributes
public/images/* -crlf -diff
.sass-cache/* -crlf -diff
Completed in 312ms (View: 192, DB: 17) | 200 OK [http://www.app.local/brackets/2]
SQL (0.1ms) SET NAMES 'utf8'
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
User Columns (1.6ms) SHOW FIELDS FROM `users`
Processing ApplicationController#index (for 127.0.0.1 at 2011-02-10 10:59:56) [GET]
Parameters: {"1296450347"=>nil}
ActionController::RoutingError (No route matches "/images/" with {:method=>:get}):
git reset -p 9c3d00aca9ee68fbf8850ce8b729f968a2d4cc11^1 -- path_to/member_steps.rb
class Bracket < ActiveRecord::Base
has_many :memberships, :as => :app
end
@DCarper
DCarper / style.sass
Created February 22, 2011 21:58
double dotted border
#wrap
padding-bottom: 10px
border-bottom: dotted white 1px
#wrap:after
border-bottom: 1px dotted white
content: ''
position: absolute
width: 100%
height: 20px
@DCarper
DCarper / test.rb
Created February 23, 2011 00:09
testing
class User < ActiveRecord::Base
end
class FantasyFootballLeague < ActiveRecord::Base
has_many :memberships, :as => :app
end
class User < ActiveRecord::Base
has_many :memberships
has_many :fantasy_football_leagues, :through => :memberships,
:source => :app,
:source_type => 'FantasyFootballLeague'
has_many :march_madness_brackets, :through => :memberships,
:source => :app,
:source_type => 'MarchMadnessBracket'
class Comment < ActiveRecord::Base
belongs_to :commentable, :polymorphic => true
has_one :user, :through => :commentable,
end
#(rdb:1) @comment.valid?
# => true
#(rdb:1) @comment.commentable.valid?
# => true
#(rdb:1) @comment.commentable.user.valid?