View layout_helper.rb
module LayoutHelper | |
## | |
# Render flash messages | |
# | |
# @param [String] attrs Attributes to add to the surrounding <div> | |
# | |
def flash_messages(attrs = {}) | |
return if flash.nil? or flash.empty? | |
closer = "<span class='close'>×</span>" |
View to_bool.rb
class Fixnum | |
def to_bool | |
self == 1 | |
end | |
end | |
def Float | |
def to_bool | |
self.to_i.to_bool | |
end |
View app.conf
#----------------------------------------------------------- | |
# If using a proxy server | |
upstream app{ | |
#server unix:///app_path/shared/sockets/app.sock fail_timeout=0; | |
server unix:///app_path/shared/sockets/app.sock; | |
} | |
#------------------------------------------------------------ |
View tables.coffee
class RTable | |
orig: null | |
wrap: null | |
pinned: null | |
constructor:(table)-> | |
@orig = $(table) | |
@orig.addClass('modified') | |
.wrap("<div class='table-wrapper'></div>") | |
@wrap = @orig.parent('div.table-wrapper') | |
@split() |
View divs.html
<div id='grid'><div id='baseline_grid'></div></div> |
View runner.js
/* | |
* Make sure coffeescript.js, jasmine, and all other dependencies are loaded, | |
* then assign a global "specs" variable which is an array of file names in | |
* your spec/ folder. | |
* | |
* window.specs = ['index']; | |
* | |
*/ | |
(function() { |
View _grid.scss
// optional, i like the light black better | |
$grid-background-column-color:rgba(black, 0.075); | |
@mixin debug-susy-grid($points){ | |
#grid{ position:absolute; top:0px; right:$grid-padding; left:$grid-padding; bottom:0px; display:none; | |
@include susy-grid-background; z-index:10000; | |
@for $i from 1 to length($points){ | |
@include at-breakpoint(nth($points, $i)){ | |
@include susy-grid-background; |
View .gemrc
--- | |
:verbose: true | |
:bulk_threshold: 1000 | |
install: --no-ri --no-rdoc --env-shebang | |
:sources: | |
- http://gems.rubyforge.org/ | |
- http://gemcutter.org | |
:benchmark: false | |
:backtrace: false | |
update: --no-ri --no-rdoc --env-shebang |
View product_spec.rb
require 'spec_helper' | |
describe Product do | |
it{ should belong_to :designer } | |
it{ should have_many :taggings } | |
it{ should have_many(:tags).through(:taggings) } | |
it{ should have_many :images } | |
it{ should have_many :product_properties } | |
it{ should have_many(:available_properties).through(:product_properties) } |
View lame.rb
def self.model_name | |
name = "Entry" | |
name.instance_eval do | |
def plural; pluralize; end | |
def singular; singularize; end | |
def i18n_key; singularize; end | |
def human(*args); singularize; end | |
end | |
return name | |
end |
NewerOlder