ExEffectiveBootstrap v0.1.17 ExEffectiveBootstrap.InputsFor View Source
Bootstrap has_many form builder
Link to this section Summary
Functions
A nested fields has_many builder. Includes Add Another and Delete buttons. Works with a regular phoenix form_for and effective_form_for
Link to this section Functions
Link to this function
effective_inputs_for(form, field, opts \\ [], fun)
View Sourceeffective_inputs_for( Phoenix.HTML.FormData.t(), atom(), Keyword.t(), (Phoenix.HTML.Form.t() -> Phoenix.HTML.unsafe()) ) :: Phoenix.HTML.safe()
A nested fields has_many builder. Includes Add Another and Delete buttons. Works with a regular phoenix form_for and effective_form_for
Example
<%= effective_form_for @changeset, @action, fn f -> %> <%= input f, :name %>
<%= effective_inputs_for f, :comments, fn comment -> %>
<%= render("_comment_fields.html", form: comment) %>
<% end %>
The _comment_fields.html must start with
<%= input @form, :title %>
<%= input @form, :body %>
Link to this function
effective_inputs_for_add_link(opts \\ [])
View Sourceeffective_inputs_for_add_link(Keyword.t()) :: Phoenix.HTML.safe()
Link to this function
effective_inputs_for_remove_link(form, field, opts \\ [])
View Sourceeffective_inputs_for_remove_link(Phoenix.HTML.FormData.t(), atom(), Keyword.t()) :: Phoenix.HTML.safe()