From 5448aba31aece5f8269ef0441fa7602d411a0c7f Mon Sep 17 00:00:00 2001 From: Jeff Casimir Date: Wed, 19 Oct 2011 23:36:49 -0400 Subject: [PATCH] Minor clarity revisions --- Readme.markdown | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Readme.markdown b/Readme.markdown index 7d470c7..8569061 100644 --- a/Readme.markdown +++ b/Readme.markdown @@ -133,11 +133,7 @@ Add the dependency to your `Gemfile`: gem "draper" ``` -Run bundle: - -``` -bundle -``` +Then run `bundle` from the project directory. ### Generate the Decorator @@ -149,7 +145,7 @@ rails generate draper:decorator Article ### Writing Methods -Open the decorator model (ex: `app/decorators/article_decorator.rb`) and add normal instance methods. To access the wrapped source object, use a method named by the source object passed to `decorates`: +Open the decorator model (ex: `app/decorators/article_decorator.rb`) and add normal instance methods. To access the wrapped source object, use a method named after the `decorates` argument: ```ruby class ArticleDecorator < ApplicationDecorator @@ -208,7 +204,7 @@ ArticleDecorator.new(Article.find(params[:id]))` ```ruby ArticleDecorator.decorate(Article.first) # Returns one instance of ArticleDecorator -ArticleDecorator.decorate(Article.all) # Returns an array of ArticleDecorator instances +ArticleDecorator.decorate(Article.all) # Returns an enumeration proxy of ArticleDecorator instances ``` * Call `.find` to do automatically do a lookup on the `decorates` class: