aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-07-08 17:18:53 +0900
committerAkira Matsuda <ronnie@dio.jp>2013-07-08 17:21:25 +0900
commit874fbdaad67a2698bef9ea512097270a4210a1fc (patch)
treec43b23d72998e80f089429d84b8305deaed18757 /guides
parent19df76f75e24851b9073d6dab637f235fab69ae4 (diff)
downloadrails-874fbdaad67a2698bef9ea512097270a4210a1fc.tar.gz
rails-874fbdaad67a2698bef9ea512097270a4210a1fc.tar.bz2
rails-874fbdaad67a2698bef9ea512097270a4210a1fc.zip
1.9 Hash Syntax
Diffstat (limited to 'guides')
-rw-r--r--guides/source/action_view_overview.md2
-rw-r--r--guides/source/active_record_callbacks.md2
-rw-r--r--guides/source/active_record_querying.md2
-rw-r--r--guides/source/index.html.erb2
4 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md
index bd8e5ce4f2..75f2989f5b 100644
--- a/guides/source/action_view_overview.md
+++ b/guides/source/action_view_overview.md
@@ -1492,7 +1492,7 @@ number_to_human_size(1234567) # => 1.2 MB
Formats a number as a percentage string.
```ruby
-number_to_percentage(100, :precision => 0) # => 100%
+number_to_percentage(100, precision: 0) # => 100%
```
#### number_to_phone
diff --git a/guides/source/active_record_callbacks.md b/guides/source/active_record_callbacks.md
index 01401cc340..2e70e64b39 100644
--- a/guides/source/active_record_callbacks.md
+++ b/guides/source/active_record_callbacks.md
@@ -343,7 +343,7 @@ By using the `after_commit` callback we can account for this case.
```ruby
class PictureFile < ActiveRecord::Base
- after_commit :delete_picture_file_from_disk, :on => [:destroy]
+ after_commit :delete_picture_file_from_disk, on: [:destroy]
def delete_picture_file_from_disk
if File.exist?(filepath)
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index 031a203f08..292d6efbb0 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -711,7 +711,7 @@ Post.order('id DESC').limit(20).unscope(:order, :limit) = Post.all
You can additionally unscope specific where clauses. For example:
```ruby
-Post.where(:id => 10).limit(1).unscope(where: :id, :limit).order('id DESC') = Post.order('id DESC')
+Post.where(id: 10).limit(1).unscope(where: :id, :limit).order('id DESC') = Post.order('id DESC')
```
### `only`
diff --git a/guides/source/index.html.erb b/guides/source/index.html.erb
index a8e4525c67..57c224c165 100644
--- a/guides/source/index.html.erb
+++ b/guides/source/index.html.erb
@@ -19,7 +19,7 @@ Ruby on Rails Guides
<h3><%= section['name'] %></h3>
<dl>
<% section['documents'].each do |document| %>
- <%= guide(document['name'], document['url'], :work_in_progress => document['work_in_progress']) do %>
+ <%= guide(document['name'], document['url'], work_in_progress: document['work_in_progress']) do %>
<p><%= document['description'] %></p>
<% end %>
<% end %>