Current section

Files

Jump to
forage lib forage_web display.ex
Raw

lib/forage_web/display.ex

defprotocol ForageWeb.Display do
@moduledoc """
A protocol to display Ecto structs as either HTML or text.
By default Ecto schemas generated by Mandarin implement this protocol.
"""
@doc """
Displays the model as plaintext.
This is meant to be used to diplay options in a select widget and
when you want to show the user a resource as HTML.
"""
def as_text(model)
@doc """
Displays the model as HTML.
This is meant to be used to diplay options in a select widget and
when you want to show the user a resource as HTML.
"""
def as_html(model)
end