module Substance::Presenter::Rails::ViewHelper
Public Instance Methods
present(object, presenter)
click to toggle source
Returns object wrapped in presenter. If object is a collection each member of the collection is wrapped and the collection is returned.
Example
<%- @foo = present(@foo, FooPresenter) -%>
# File lib/substance/rails/view_helper.rb, line 17 def present(object, presenter) if object.is_a?(Enumerable) presenter.present_collection(object, self) else presenter.present(object, self) end end