ICalendar.encode_to_iodata
You're seeing just the function
encode_to_iodata
, go back to ICalendar module for more information.
To create a Phoenix/Plug controller and view that output ics format:
Add to your config.exs:
config :phoenix, :format_encoders,
ics: ICalendar
In your controller use:
calendar = %ICalendar{ events: events }
render(conn, "index.ics", calendar: calendar)
The important part here is .ics
. This triggers the format_encoder
.
In your view can put:
def render("index.ics", %{calendar: calendar}) do
calendar
end