diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2013-09-14 13:55:31 -0700 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-09-14 13:55:31 -0700 |
commit | f5268a0823bbb078a8b84d244e5e359729705baf (patch) | |
tree | bf6abf2b7ae274e42551d45f3e74069bc03d97fb /guides/source/plugins.md | |
parent | aeef940540ca169879e40b4d70d0a97b9d6cf21e (diff) | |
parent | 3988dcc4eb4b5b70b229c4dc45e9169c3488ff88 (diff) | |
download | rails-f5268a0823bbb078a8b84d244e5e359729705baf.tar.gz rails-f5268a0823bbb078a8b84d244e5e359729705baf.tar.bz2 rails-f5268a0823bbb078a8b84d244e5e359729705baf.zip |
Merge pull request #12231 from harshadsabne/master
[ci skip] Update plugins.md
Diffstat (limited to 'guides/source/plugins.md')
-rw-r--r-- | guides/source/plugins.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/guides/source/plugins.md b/guides/source/plugins.md index b52504b104..ca55ee0df2 100644 --- a/guides/source/plugins.md +++ b/guides/source/plugins.md @@ -15,7 +15,7 @@ After reading this guide, you will know: This guide describes how to build a test-driven plugin that will: * Extend core Ruby classes like Hash and String. -* Add methods to ActiveRecord::Base in the tradition of the 'acts_as' plugins. +* Add methods to `ActiveRecord::Base` in the tradition of the `acts_as` plugins. * Give you information about where to put generators in your plugin. For the purpose of this guide pretend for a moment that you are an avid bird watcher. @@ -126,8 +126,8 @@ $ rails console Add an "acts_as" Method to Active Record ---------------------------------------- -A common pattern in plugins is to add a method called 'acts_as_something' to models. In this case, you -want to write a method called 'acts_as_yaffle' that adds a 'squawk' method to your Active Record models. +A common pattern in plugins is to add a method called `acts_as_something` to models. In this case, you +want to write a method called `acts_as_yaffle` that adds a `squawk` method to your Active Record models. To begin, set up your files so that you have: @@ -162,9 +162,9 @@ end ### Add a Class Method -This plugin will expect that you've added a method to your model named 'last_squawk'. However, the -plugin users might have already defined a method on their model named 'last_squawk' that they use -for something else. This plugin will allow the name to be changed by adding a class method called 'yaffle_text_field'. +This plugin will expect that you've added a method to your model named `last_squawk`. However, the +plugin users might have already defined a method on their model named `last_squawk` that they use +for something else. This plugin will allow the name to be changed by adding a class method called `yaffle_text_field`. To start out, write a failing test that shows the behavior you'd like: |