Skip to content

blaknite/blush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blush

View-Models for Rails.

Installation

gem 'blush'

Usage

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)

Releases

No releases published

Packages

No packages published

Languages