Open ChrisZou opened 6 years ago
@ChrisZou When I save data I get this exception:
Protocol.UndefinedError at GET /packages/1 protocol Phoenix.HTML.Safe not implemented for %{file_name: "Golf-Club-Green-icon.png", updated_at: #Ecto.DateTime<2017-10-13 13:10:15>}. This protocol is implemented for: Atom, BitString, Date, DateTime, Decimal, Ecto.Date, Ecto.DateTime, Ecto.Time, Float, Integer, List, NaiveDateTime, Time, Tuple
The file name is saved with: Golf-Club-Green-icon.png?63675119415 have you had the same issue?
@CodelessFuture No. I think that was a different issue.
I agree with @ChrisZou .. Should be tuned to the new Pheonix 1.3 folder structure.
Second this. Also regarding arc_ecto
package. I Was getting this error:
invalid or unknown type MyApp.PositionPhoto.Type for field :photo
until I moved the generated file to /myapp_web
folder and changed the module from MyApp.PositionPhoto
to MyAppWeb.PositionPhoto
, then it worked.
Nice library BTW. Sorry for complaining without doing a PR. 😛
After run
mix arc.g avatar
, the generatedAvatar
module is put inapp_root/web/uploaders/
. while in a newly created Phoenix 1.3 app, theapp_root/web
is not used by default, and the corresponding folder isapp_root/lib/appname_web
, e.g.blog/lib/blog_web
. As a result, it shows(UndefinedFunctionError) function MyApp.Avatar.store/1 is undefined (module MyApp.Avatar is not available)
when I callAvatar.store(...)
(I didalias MyApp.Avatar
first). Although after moving the file toapp_root/lib/appname_web
manually, it works fine. It did take me sometime to figure out the problem. So I think it would be nice to move the generated file toapp_root/lib/appname_web/uploader
, or at least mention this in the guide?