Skip to content

Instantly share code, notes, and snippets.

# Run
rails rails_app_name -m http://github.com/dreamr/dream_template/raw/master/base.rb
# Then
cd rails_app_name
rake db:create && rake db:migrate
rake gems:install
rake gems:unpack
# To start up autospec
## Bid controller
actions: create
views: new, form (partial including the form)
## Pictures controller
actions: index, new, create, edit, update, destroy
views: same ^^
We couldn’t find that file to show.
We couldn’t find that file to show.
@dreamr
dreamr / person.rb
Created January 5, 2010 09:26 — forked from Mikr0Tik/person.rb
class Person < ActiveRecord::Base
before_save :before_save_foo, :before_save_bar
before_create :before_create_claat
before_validation :before_validation_bar
after_save :after_save_clean_skip_callbacks
attr_accessor :skip_callbacks
SKIPPABLE_CALLBACKS = [:before_save_foo, :before_save_bar]
SKIPPABLE_CALLBACKS.each do |cb|
Hello. My name is Johnathan and I am from Craig, Colorado. Look it up on google maps and rate it in your head of total suckiness.
I want to get out of here very very badly, and I now have some work lined up in Los Angeles, studying under one of the top 100 rails coders in the world. I have a friend out there that has a room for me to stay in while I get on my feet. Everything is all set EXCEPT;
I need a bus ticket out of this hell hole. That is it. I have enough money to scrape by on once my ticket is paid for.
SO!!! I am asking for YOUR help. My Ruby and Rails community. Some of you make very good money, some of you understand the value of a dream. Give $5 or $10 bucks and call it a beer. It's one of the things that makes our community so great.
ActionController::Routing::Routes.draw do |map|
map.with_options :controller => 'static' do |static|
static.home '/', :action => 'home'
static.home '/home', :action => 'home'
static.dogma '/practices', :action => 'practices'
static.projects '/projects', :action => 'projects'
static.access_denied '/access-denied', :action => 'denied'
end
ActiveRecord::Base.class_eval do
def self.validates_inlcusion_of(*attr_names)
configuration = { :minumum => 1 }
configuration.update(attr_names.extract_options!)
validates_each(attr_names, configuration) do |record, attr_name, value|
unless value.nil?
record.errors.add(attr_name, "must contain at least #{configuration[:minimum]}") if value.size < configuration[:minimum].to_i
end
end
require 'spec'
Autotest.add_discovery do
"rspec"
end
GEMS=`gem list --no-versions`
for x in $GEMS ; do sudo gem uninstall $x -i ~/.gem/ruby/1.8/; done