ExEffectiveBootstrap v0.1.17 ExEffectiveBootstrap.ShowIf View Source
The show_if helper for use within an effective_form
Link to this section Summary
Functions
Automatically show/hide the content when the given form and field has the given value
Automatically show/hide the content when the given form and field has the given value
Link to this section Functions
Link to this function
hide_if(form, field, value, list)
View Sourcehide_if(Phoenix.HTML.Form.t(), atom(), any(), {:do, Phoenix.HTML.Safe.t()}) :: Phoenix.HTML.Safe.t()
Automatically show/hide the content when the given form and field has the given value
Link to this function
show_if(form, field, value, list)
View Sourceshow_if(Phoenix.HTML.Form.t(), atom(), any(), {:do, Phoenix.HTML.Safe.t()}) :: Phoenix.HTML.Safe.t()
Automatically show/hide the content when the given form and field has the given value
Examples:
<%= input f, :status, select: ["active", "disabled"]
<%= show_if(f, :status, "active") do %>
This is displayed when the status select field option is "active"
<% end %>