while trying to follow the examples in Phoenix Programming (Book) Release P1.0 > ,everything works fine until he is asked to add lines:
while
defimpl Phoenix.Param, for: Rumbl.Video do def to_param(%{slug: slug, id: id}) do "#{id}-#{slug}" end end
to: rumbl/web/models/video.ex
rumbl/web/models/video.ex
Before adding lines, the tests will pass (as expected):https://travis-ci.org/dwyl/learn-phoenix-framework/builds/207894163#L384
But after adding defimpl tests will fail:https://travis-ci.org/dwyl/learn-phoenix-framework/builds/207901757#L349
defimpl
Error message for two failed tests:
** (FunctionClauseError) no function clause matching in Phoenix.Param.Rumbl.Video.to_param/1
Stack Trace: https://travis-ci.org/dwyl/learn-phoenix-framework/builds/207901757#L349
Snapshot of the code when these 5 lines were added: https://github.com/dwyl/learn-phoenix-framework/pull/42/commits/db72acbe83b184cd6ce3fe342ee51c3e39eb5de8
Any help with understanding this would be much appreciated!
Note. I tried to play (for a while) ...I read dozens of similar questions on SO and https://elixirforum.com ...but no one helped. I seem to be the only one who saw this error!Posting a StackOverflow question is my "last resort" before giving up programming! :-(
On the Phoenix Programming error page: https://pragprog.com/titles/phoenix/errata, there is another person reporting a problem with the same code, but their error is different ...
No one has answered this question yet.
See related questions:
Source: https://habr.com/ru/post/1265058/More articles:Can I use next level output as the current Keras input layer? - nlppassing and enforcing member function in java - javaElevated RecyclerView elements gradually warp (height changes) - androidCapturing Snapshot AVCaptureVideoPreviewLayer - iosSinch VOIP pushkit does not work with pushkit - iosC #: constructor constructor performance - constructorDoes the break in Cython / C ++ definitions overload cppclass? - pythonFetch API can't load, cors - getCocoaPods "has transitive dependencies that include static binaries" - xcodeThe difference between waiting and listening in Dart - streamAll Articles