Skip to content

Instantly share code, notes, and snippets.

@tatsuosakurai
Created August 22, 2011 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatsuosakurai/1161697 to your computer and use it in GitHub Desktop.
Save tatsuosakurai/1161697 to your computer and use it in GitHub Desktop.
rails memo
# blank project
rails new app_name -T -J -d mysql
cd app_name
bundle
# rails g jquery:install #3.1、3.2から不要?
rails g rspec:install
rails g controller sample index
rails g model book name:string hoge:integer user:references
rake db:migrate
# メソッドの定義されている場所を探す
Model.method(:method_name).source_location
# Factory
FactoryGirl.define do
factory : user do
sequence(:name){|n| "use_#{n}" }
end
factory :belonging do
association :user
end
end
# gem
gem pristine gem名 #gemをインストール時の状態に戻す
# bundler
$GEM_HOME #システムにインストールされたGemが格納されるディレクトリへの環境変数
# Pry
pry -r ./config/environment
# gerrit
git commit --amend --author="tatsuo.sakurai <t.sakurai@everyleaf.com>"
# git
git remote -v
# coffee
@hoge_fuga = 0
@["hoge_#{fuga}"] = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment