vobject v0.1.0 ICalendar View Source

Generating ICalendars

Link to this section Summary

Functions

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

Link to this section Functions

Link to this function encode_to_iodata(calendar, options \\ []) View Source

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
Link to this function encode_to_iodata!(calendar, options \\ []) View Source