diff options
author | Harshad Sabne <harshadsabne@users.noreply.github.com> | 2013-09-14 17:56:08 +0530 |
---|---|---|
committer | Harshad Sabne <harshadsabne@users.noreply.github.com> | 2013-09-14 17:56:08 +0530 |
commit | 3988dcc4eb4b5b70b229c4dc45e9169c3488ff88 (patch) | |
tree | 3afd297bea1affa1418f3a1bff668bad4d7a46f7 /guides | |
parent | e64b8c605e166d19ddf0cdc07599001441767cb0 (diff) | |
download | rails-3988dcc4eb4b5b70b229c4dc45e9169c3488ff88.tar.gz rails-3988dcc4eb4b5b70b229c4dc45e9169c3488ff88.tar.bz2 rails-3988dcc4eb4b5b70b229c4dc45e9169c3488ff88.zip |
[ci skip] Update plugins.md
Highlighted code.
Diffstat (limited to 'guides')
-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: |