EpochtalkServerWeb.PreferenceView (epochtalk_server v0.1.0)
Renders and formats Preference
data, in JSON format for frontend
Link to this section Summary
Functions
The resource name, as an atom, for this view
Renders formatted JSON response for user preferences.
Callback invoked when no template is found. By default it raises but can be customized to render a particular template.
Link to this section Functions
__resource__()
The resource name, as an atom, for this view
render(template, assigns \\ %{})
Renders formatted JSON response for user preferences.
example
Example
iex> EpochtalkServerWeb.PreferenceView.render("preferences.json", %{preferences: nil}) %{
posts_per_page: 25,
threads_per_page: 25,
collapsed_categories: [],
ignored_boards: [],
timezone_offset: "",
notify_replied_threads: true,
ignore_newbies: false,
patroller_view: false,
email_mentions: true,
email_messages: true
} iex> preferences = %{ iex> posts_per_page: 25, iex> threads_per_page: 25, iex> collapsed_categories: %{"cats" => []}, iex> ignored_boards: %{"boards" => []}, iex> timezone_offset: "", iex> notify_replied_threads: true, iex> ignore_newbies: false, iex> patroller_view: false, iex> email_mentions: true, iex> email_messages: true iex> } iex> EpochtalkServerWeb.PreferenceView.render("preferences.json", %{preferences: preferences})
template_not_found(template, assigns)
@spec template_not_found(Phoenix.Template.name(), map()) :: no_return()
Callback invoked when no template is found. By default it raises but can be customized to render a particular template.