JsonView.render_custom_fields
You're seeing just the function
render_custom_fields
, go back to JsonView module for more information.
Render field with custom render function
View module must defines render_field/2
function to render each custom field
use JsonView
def render_field(:is_success, item) do
item.state > 3
end
# then this invoke above function
render_custom_fields(struct, __MODULE__, [:is_success])