This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Bid controller | |
actions: create | |
views: new, form (partial including the form) | |
## Pictures controller | |
actions: index, new, create, edit, update, destroy | |
views: same ^^ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec' | |
Autotest.add_discovery do | |
"rspec" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEMS=`gem list --no-versions` | |
for x in $GEMS ; do sudo gem uninstall $x -i ~/.gem/ruby/1.8/; done |
OlderNewer