Formex - a form library for Phoenix inspired by Symfony

create_form is undefined means that you are not using Formex.Controller.

Make sure you added this in web/web.ex:

def controller do
  quote do
    use Phoenix.Controller
    # ...
    use Formex.Controller # <-- make sure you added this
  end
end
3 Likes

Thanks man! I managed to finally create a collection form, something i’ve been banging my head against for two days!! I love your library it makes things so much easier man! really I you did a great job! Well done :):slight_smile:

1 Like

This looks interesting! I just stumbled across it today, and I am looking forward to trying it out.

I come from a Symfony background too and I have always considered the form component to be one of the best (and maybe underappreciated) aspects of the framework - for appropriate use cases it is very flexible and a fantastic time-saver.

I’m getting the same error if I use

use Formex.Ecto.Controller

but if I do

use Formex.Controller

The error is gone.

I added both formex and formex-ecto dependencies for phoenix 1.4.

{:formex, "~> 0.6.0"},
{:formex_ecto, "~> 0.2.0"}

My config:

config :formex,
   repo: Fumigate.Repo,
   Formex.Ecto.ChangesetValidator

Also I couldn’t use formex_form_for in the template unless I add it in the app_web.ex

def view do
  quote do
     # ...
     use Formex.View

Thank you for the library.

2 Likes