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
$ bundle exec spork | |
Using RSpec, Rails | |
Preloading Rails environment | |
Loading Spork.prefork block... | |
Address already in use - bind(2) (Errno::EADDRINUSE) | |
/Users/taniguchidaiki/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:879:in `initialize' | |
/Users/taniguchidaiki/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:879:in `open' | |
/Users/taniguchidaiki/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:879:in `open_server' | |
/Users/taniguchidaiki/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:764:in `block in open_server' |
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
$ rails generate scaffold User name:string email:string | |
$ rake db:migrate #マイグレーションファイルを実行(dbの作成) |
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
--colour | |
--drb |
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
#配列要素の分割 | |
> "foo bar bazz".split | |
=> ["foo", "bar", "bazz"] | |
#配列要素の指定文字列での分割 | |
> "fooxbarxxxxbazz".split('x') | |
=> ["foo", "bar", "", "", "", "bazz"] | |
#配列要素の順番入れ替え |
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
#ブロックを受け取るメソッドの定義 | |
def give_me_block | |
yield | |
end | |
#メソッドの引数としてブロック(do~end)を渡して、実行 | |
give_me_block do | |
p "Hello, block!" | |
end | |
=> "Hello, block!" #give_me_block内で、yieldによって呼び出された。 |
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
gem 'bootstrap-datetimepicker-rails' |
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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
#ruby-gemset=railstutorial_rails_4_0 | |
gem 'rails', '4.0.1' | |
gem 'bootstrap-sass', '2.3.2.0' |
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
<%= link_to "About", about_path %> |
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
<%= link_to "About", about_path %> |
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
module ApplicationHelper | |
# ページごとの完全なタイトルを返却 | |
def full_title(page_title) | |
base_title = "Ruby on Rails Tutorial Sample App" | |
if page_title.empty? | |
base_title | |
else | |
"#{base_title} | #{page_title}" | |
end | |
end |
OlderNewer