   def create(conn, defn, params) do
     model = defn.__struct__
     resource = conn.assigns.resource
-    resource_model = defn.resource_model |> base_name |> String.downcase |> String.to_atom
+    resource_name = resource_name(defn)
+
     changeset_fn = Keyword.get(defn.changesets, :create, &resource.__struct__.changeset/2)
-    changeset = ExAdmin.Repo.changeset(changeset_fn, resource, params[resource_model])
+    changeset = ExAdmin.Repo.changeset(changeset_fn, resource, params[resource_name])
 
     case ExAdmin.Repo.insert(changeset) do
       {:error, changeset} ->

      end
    end
  end
  defp send_resp(conn, default_status, default_content_type, body) do
    conn
    |> ensure_resp_content_type(default_content_type)

  @moduledoc false
  use ExAdmin.Web, :controller
  require Logger
  import ExAdmin.Utils
  import ExAdmin.ParamsToAtoms
  require IEx
