ex_admin icon indicating copy to clipboard operation
ex_admin copied to clipboard

embed model issue

Open sobolevn opened this issue 8 years ago • 2 comments

Working with the latest hex release:

schema "events" do
    embeds_many :partners, MyApp.Partner
end

defmodule MyApp.Partner do
  use Ecto.Schema

  embedded_schema do
    field :url
    field :image

    timestamps
  end
end

And the default admin form, results in:

Protocol.UndefinedError at GET /admin/events/new protocol String.Chars not implemented for {:embed, %Ecto.Embedded{cardinality: :many, field: :partners, on_cast: :changeset, on_replace: :raise, owner: MyApp.Event, related: MyApp.Partner, strategy: :replace}}

sobolevn avatar Aug 18 '16 13:08 sobolevn

We don’t yet support embedded_schema.

On Aug 18, 2016, at 9:56 AM, Sobolev Nikita [email protected] wrote:

Working with the latest hex release:

schema "events" do embeds_many :partners, MyApp.Partner end

defmodule MyApp.Partner do use Ecto.Schema

embedded_schema do field :url field :image

timestamps

end end And the default admin form, results in:

Protocol.UndefinedError at GET /admin/events/new protocol String.Chars not implemented for {:embed, %Ecto.Embedded{cardinality: :many, field: :partners, on_cast: :changeset, on_replace: :raise, owner: MyApp.Event, related: MyApp.Partner, strategy: :replace}}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/smpallen99/ex_admin/issues/197, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2YpbaN98dLUDlVLJHQhF_9GgCTsT1nks5qhGR6gaJpZM4Jng6c.

smpallen99 avatar Aug 18 '16 20:08 smpallen99

It seems works now with https://github.com/smpallen99/ex_admin/commit/115ea72622828d1bff40028a22c49cd032e8fdc1

linjunpop avatar Jun 22 '17 02:06 linjunpop