Skip to content

Commit

Permalink
Merge pull request #1 from cylence/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
jwaldrip committed Oct 26, 2012
2 parents aee4f57 + c595750 commit 4841791
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -45,7 +44,6 @@ class ContactPresenter < DelegatedPresenter::Base
def full_name
[prefix, first_name, middle_initial, last_name, suffix].compact.join(' ')
end

end
```

Expand All @@ -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
```

Expand All @@ -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
```

Expand All @@ -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
```

Expand All @@ -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
Expand Down

0 comments on commit 4841791

Please sign in to comment.