Ex_admin with Phoenix 1.3

Has anyone successfully used ex_admin with Phoenix 1.3?

I’ve done the following:

mix phx.new admin_test
cd admin_test/
mix ecto.create

Add ex_admin from github to deps: {:ex_admin, github: "smpallen99/ex_admin"}

Add the config macro:

config :ex_admin,
  repo: AdminTest.Repo,
  module: AdminTestWeb,    # MyProject.Web for phoenix >= 1.3.0-rc
  modules: [
    AdminTest.ExAdmin.Dashboard,
  ]

Compile: mix do deps.get, deps.compile

Now to configure ex_admin:

Marks-MBP:admin_test mkaravan$ mix admin.install
** (Mix) Can't find brunch-config.js

Annoying. I can symlink it with ln -s assets/brunch-config.js . . Now when I run admin.install I get this:

Marks-MBP:admin_test mkaravan$ mix admin.install
* creating css files
* creating js files
* updating config/config.exs
** (ArgumentError) application :gettext is not loaded, or the configuration parameter :default_locale is not set
    (elixir) lib/application.ex:281: Application.fetch_env!/2
    lib/gettext.ex:677: Gettext.dgettext/4
    lib/mix/tasks/admin.install.ex:229: Mix.Tasks.Admin.Install.do_dashboard/1
    lib/mix/tasks/admin.install.ex:57: Mix.Tasks.Admin.Install.do_install/1
    (mix) lib/mix/task.ex:301: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:75: Mix.CLI.run_task/2

Ok, so I add :gettext to the application and give it a config

      def application do
        [
          mod: {AdminTest.Application, []},
          extra_applications: [:logger, :runtime_tools, :gettext]
        ]
      end
config :admin_test, AdminTest.Gettext, default_locale: "en_US"

If I run mix admin.install, I get the same error again. Does anyone know where to go from here?

The author seems to have abandoned the project and is working on a ‘new edition’ called Tafon:

https://github.com/smpallen99/ex_admin/issues/405

1 Like