diff --git a/lib/phoenix_bootstrap_form.ex b/lib/phoenix_bootstrap_form.ex index 0628b57..e8feb57 100644 --- a/lib/phoenix_bootstrap_form.ex +++ b/lib/phoenix_bootstrap_form.ex @@ -11,7 +11,7 @@ defmodule PhoenixBootstrapForm do draw_generic_input(:select, form, field, options, opts) end - [:text_input, :file_input, :email_input, :password_input, :textarea, :telephone_input] + [:text_input, :file_input, :email_input, :password_input, :textarea, :telephone_input, :number_input] |> Enum.each(fn method -> def unquote(method)(form = %Form{}, field, opts \\ []) when is_atom(field) do draw_generic_input(unquote(method), form, field, nil, opts) @@ -270,6 +270,10 @@ defmodule PhoenixBootstrapForm do Form.select(form, field, options, merge_css_classes(opts)) end + defp draw_input(:number_input, form, field, nil, opts) do + Form.number_input(form, field, merge_css_classes(opts)) + end + defp draw_input(type, form, field, nil, opts) do apply(Form, type, [form, field, merge_css_classes(opts)]) end