This file contains hidden or 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
| # Copy database.yml | |
| run 'cp config/database.yml config/database.yml.example' | |
| # Delete unnecessary files | |
| run 'rm README' | |
| run 'rm public/index.html' | |
| # Install plugins | |
| plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git' | |
| plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git' |
This file contains hidden or 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
| # 勉強会メモ | |
| n次元からn-1次元への展開 | |
| 超立方体 | |
| 微分の概念 | |
| 瞬間の速度を求めたい | |
| スピードガン | |
| ドップラー効果 | |
| マイクロ波 |
This file contains hidden or 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
| rails my_app | |
| cd my_app | |
| ruby script/generate model user name:string email:string | |
| ruby script/generate model entry title:string body:text user_id:integer | |
| rake db:migrate | |
| ruby script/generate i18n ja |
This file contains hidden or 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 User < ActiveRecord::Base | |
| has_many :entries | |
| accepts_nested_attributes_for :entries | |
| validates_presence_of :name, :email | |
| end |
This file contains hidden or 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 Entry < ActiveRecord::Base | |
| belongs_to :user | |
| validates_presence_of :title, :body | |
| end |
This file contains hidden or 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
| u = User.new | |
| u.entries.build | |
| u.valid? | |
| u.errors.full_messages | |
| #=> ["名前を入力してください。", "Entries bodyを入力してください。", "Entries titleを入力してください。", "Eメールを入力してください。"] |
This file contains hidden or 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
| ja: | |
| activerecord: | |
| models: | |
| entry: エントリ | |
| user: ユーザ | |
| attributes: | |
| entry: | |
| title: タイトル | |
| body: 体 | |
| user: |
This file contains hidden or 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
| u.errors.full_messages | |
| #=> ["名前を入力してください。", "本文を入力してください。", "タイトルを入力してください。", "Eメールを入力してください。"] |
This file contains hidden or 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
| # coding: utf-8 | |
| # 定数をモジュールにすることでグルーピングする試み | |
| class Foo | |
| module Statuses | |
| INVALID = 0 | |
| VALID = 1 | |
| end | |
| include Statuses |
This file contains hidden or 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
| RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION | |
| require File.join(File.dirname(__FILE__), 'boot') | |
| Rails::Initializer.run do |config| | |
| # testing | |
| config.gem 'rspec', :lib => false | |
| config.gem 'rr', :lib => false | |
| config.gem 'rspec-rails', :lib => false | |
| config.gem 'bmabey-email_spec', :lib => 'email_spec', :source => 'http://gems.github.com' |