Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #21 from manuelmeurer/patch-1

Fixed formatting in Readme
  • Loading branch information...
commit 62d80310f437744fb2a40987da619da7577cec29 2 parents 3687f9e + 198b4fe
@leshill authored
Showing with 17 additions and 15 deletions.
  1. +17 −15 Readme.markdown
View
32 Readme.markdown
@@ -102,11 +102,11 @@ end
```
```irb
- > ad = ArticleDecorator.find(1)
- => #<ArticleDecorator:0x000001020d7728 @model=#<Article id: 1, title: "Hello, World">>
- > ad.title
- => "Hello, World"
- > ad.created_at
+> ad = ArticleDecorator.find(1)
+=> #<ArticleDecorator:0x000001020d7728 @model=#<Article id: 1, title: "Hello, World">>
+> ad.title
+=> "Hello, World"
+> ad.created_at
NoMethodError: undefined method `created_at' for #<ArticleDecorator:0x000001020d7728>
```
@@ -199,20 +199,22 @@ When writing your controller actions, you have three options:
* Call `.new` and pass in the object to be wrapped
- ```ruby
- ArticleDecorator.new(Article.find(params[:id]))`
- ```
+```ruby
+ArticleDecorator.new(Article.find(params[:id]))`
+```
* Call `.decorate` and pass in an object or collection of objects to be wrapped:
- ```ruby
- ArticleDecorator.decorate(Article.first) # Returns one instance of ArticleDecorator
- ArticleDecorator.decorate(Article.all) # Returns an array of ArticleDecorator instances
- ```
+
+```ruby
+ArticleDecorator.decorate(Article.first) # Returns one instance of ArticleDecorator
+ArticleDecorator.decorate(Article.all) # Returns an array of ArticleDecorator instances
+```
* Call `.find` to do automatically do a lookup on the `decorates` class:
- ```ruby
- ArticleDecorator.find(1)
- ```
+
+```ruby
+ArticleDecorator.find(1)
+```
### In Your Views
Please sign in to comment.
Something went wrong with that request. Please try again.