From 7961a488bd788d4dce25a3f42afde5627aac003d Mon Sep 17 00:00:00 2001 From: BroHand Date: Fri, 18 Mar 2016 09:13:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=8C=AF=E5=AD=97=E6=9B=B4=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter1-mvc/c/respond_to__respond_with.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter1-mvc/c/respond_to__respond_with.md b/chapter1-mvc/c/respond_to__respond_with.md index b749131..3a20c45 100644 --- a/chapter1-mvc/c/respond_to__respond_with.md +++ b/chapter1-mvc/c/respond_to__respond_with.md @@ -1,6 +1,6 @@ # respond_to 與 respond_with -respond_to可以用來回應不同的資料格式,如果使用者要get www.example.com/ex.xml,rails會先尋找`ex.xml.erb`和`ex.xml.buulder`,最後會找`ex.html.erb`的檔案。 +respond_to可以用來回應不同的資料格式,如果使用者要get www.example.com/ex.xml,rails會先尋找`ex.xml.erb`和`ex.xml.builder`,最後會找`ex.html.erb`的檔案。 ```ruby def index From 3a712dcee2b8048a372dabbcbb16fdb0c19106ca Mon Sep 17 00:00:00 2001 From: BroHand Date: Wed, 23 Mar 2016 09:55:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B7=AF=E5=BE=91=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter1-mvc/m/collections-id.md | 2 +- chapter3-ruby/map.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter1-mvc/m/collections-id.md b/chapter1-mvc/m/collections-id.md index daf2d3d..f8e2e22 100644 --- a/chapter1-mvc/m/collections-id.md +++ b/chapter1-mvc/m/collections-id.md @@ -1,7 +1,7 @@ # collect(&:id) -基本上跟[map](../chapter3-ruby/map.md)是一樣的東西,collect做的事情就是將array內的資料一一拿出來處理,處理完後再傳回array +基本上跟[map](../../chapter3-ruby/map.md)是一樣的東西,collect做的事情就是將array內的資料一一拿出來處理,處理完後再傳回array 所以`topics.collect(&:id)`就是把topics內所有的id都拿出來存成另一個array ex: diff --git a/chapter3-ruby/map.md b/chapter3-ruby/map.md index 008b305..bf42e20 100644 --- a/chapter3-ruby/map.md +++ b/chapter3-ruby/map.md @@ -1,3 +1,3 @@ # map -基本上跟collect是一樣的方法,可以參考Model的[collect(&:id)](../chapter1-mvc/collect&id.md)介紹即可。 +基本上跟collect是一樣的方法,可以參考Model的[collect(&:id)](../chapter1-mvc/m/collections-id.md)介紹即可。 From 5aece170862ad29ba582ca6db100fbb7a656992f Mon Sep 17 00:00:00 2001 From: BroHand Date: Thu, 24 Mar 2016 10:39:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=A8=8B=E5=BC=8F?= =?UTF-8?q?=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter4-ruby/loop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter4-ruby/loop.md b/chapter4-ruby/loop.md index d15a20c..d5619ca 100644 --- a/chapter4-ruby/loop.md +++ b/chapter4-ruby/loop.md @@ -5,7 +5,7 @@ ``` ruby 10.times {|n| puts "This is #{n}"} -10.times.do |n| +10.times do |n| puts "This is #{n}" puts "That is #{n*2}" end