resources :users do
get 'hoge' # 1
get ':id/hoge' # 2
endresources :users do
collection do| CC = "gcc" | |
| task :default => "hello" | |
| file "hello" => "hello.o" do | |
| sh "#{CC} -o hello hello.o" | |
| end | |
| file "hello.o" => "hello.c" do | |
| sh "#{CC} -c hello.c" |
| git push origin :BRACH_NAME |
resources :users do
get 'hoge' # 1
get ':id/hoge' # 2
endresources :users do
collection do| .field_with_errors | |
| @include formFieldState(#b94a48, #ee5f5b, lighten(#ee5f5b, 30%)) | |
| @extend .error |
| source :rubygems | |
| gem 'clockwork' | |
| gem 'heroku' | |
| gem 'active_support' | |
| gem 'lingman', git: 'git://github.com/hrysd/lingman.git' |
| source :rubygems | |
| gem 'garb' | |
| gem 'active_support' |
| # Mainモジュール | |
| # ワーカープロセスを実行するユーザーの指定 | |
| user www-data; | |
| # ワーカープロセスの数。さくらのVPSのコア数にあわせた。 | |
| worker_processes 2; | |
| # 全体でのエラーログの詳細度の指定。 | |
| error_log logs/error.log notice; |
@hoge = Hoge.new(params[:hoge]) do |h|
h.user = current_user
end
Hoge.create(params[:hoge]) do |h|
h.user = current_user
end
User.create([{ name: 'hoge'}, { name: 'huga' }, { name: 'piyo' }]) do |u|| export PS1='\[\033[1;34m\][\w]\[\033[0m\]\[\033[1;32m\]$(__git_ps1)\[\033[00m\]\[\033[1;36m\]>\[\033[0m\] ' |
class Account < ActiveRecord::Base
with_options :dependent => :destroy do |assoc|
assoc.has_many :customers
assoc.has_many :products
assoc.has_many :invoices
assoc.has_many :expenses
end
end