An incomplete cheatsheet for rails 3. Things are added as they are required.
## Debugging
Check errors
@user = User.new(:email => email)
puts @user.valid?
@user.errors.each { |e| puts "#{e}: #{@user.errors[e]}" }
An incomplete cheatsheet for rails 3. Things are added as they are required.
## Debugging
Check errors
@user = User.new(:email => email)
puts @user.valid?
@user.errors.each { |e| puts "#{e}: #{@user.errors[e]}" }
def get_css_class(str) | |
"class-#{str.downcase.gsub(/\W/, "-")}" if str.present? | |
end |
@import 'reset'; | |
@import 'typography'; | |
/* Variables | |
-----------------------------------------------------------------------------*/ | |
/* Colours */ | |
/* General styles |
require 'mongo_mapper'
def setup_mongo_connection(mongo_url)
Server dumps of env.to_yaml
to replicate the rack-protection bug. Only seems to be an issue with IE9, without set :protection, except: :session_hijacking
set.
I have the following setup:
rack (1.4.1)
rack-force_domain (0.2.0)
rack-protection (1.2.0)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
# Ship it! rake task | |
# | |
# Merge branch (master by default) to deployment branch, and deploy to server. | |
# | |
# Prerequisite: | |
# | |
# * Declare all deployment branches in `ALL_DEPLOYMENT_BRANCHES` | |
# * Declare deploy only branches in `DEPLOY_ONLY_BRANCHES` (ie, does not merge master) | |
# * Modify `Deploy.command` function as necessary | |
# |
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"folder_exclude_patterns": | |
[ | |
".svn", | |
".git", | |
".hg", | |
"CVS", | |
".sass-cache", | |
"tmp" |