Permalink
Browse files

Merge pull request #1 from cylence/patch-1

Update README.md
  • Loading branch information...
2 parents aee4f57 + c595750 commit 4841791ca5df8863a3ccb0c05519f739e7defa24 @jwaldrip committed Oct 26, 2012
Showing with 0 additions and 13 deletions.
  1. +0 −13 README.md
View
@@ -28,7 +28,6 @@ Or install it yourself as:
```ruby
class ContactPresenter < DelegatedPresenter::Base
-
# By default this presenter will try and present a Contact if it exists.
# You can explicitly tell the presenter to present other models using the following syntax:
@@ -45,7 +44,6 @@ class ContactPresenter < DelegatedPresenter::Base
def full_name
[prefix, first_name, middle_initial, last_name, suffix].compact.join(' ')
end
-
end
```
@@ -58,19 +56,15 @@ There are two helper methods in the presenter.
```ruby
class ContactPresenter < DelegatedPresenter::Base
-
hide :id, :crypted_password
-
end
```
or:
```ruby
class ContactPresenter < DelegatedPresenter::Base
-
expose :first_name, :last_name
-
end
```
@@ -82,9 +76,7 @@ Use the following to present a model instance or collection with a presenter, by
```ruby
class ContactsController < ApplicationController
-
presents :contact
-
end
```
@@ -93,9 +85,7 @@ If you for any reason need to explicitly define the presenter you may define a `
```ruby
class UsersController < ApplicationController
-
presents :user, with: :contact_presenter
-
end
```
@@ -104,17 +94,14 @@ end
```ruby
class ContactsController < ApplicationController
-
def index
@contacts = ContactPresenter.new Contact.all
end
def show
@contact = ContactPresenter.new Contact.find(params[:id])
end
-
end
-
```
## Contributing

0 comments on commit 4841791

Please sign in to comment.