An open API service indexing awesome lists of open source software.

https://github.com/blaknite/blush

View-Models for Rails.
https://github.com/blaknite/blush

decorators presenters rails view-model

Last synced: about 1 year ago
JSON representation

View-Models for Rails.

Awesome Lists containing this project

README

          

# Blush

View-Models for Rails.

## Installation

```ruby
gem 'blush'
```

## Usage

```ruby
class Comment < ActiveRecord::Base
has_presenter
end

class CommentPresenter < Blush::Presenter
def content
h.simple_format(object.content)
end
end

# explicitly call the presenter methods
@comment.presenter.content

# delegate to the model if method doesn't exist on presenter
@comment.present(:content)
```