Closed nelsonic closed 7 years ago
The issue was that I skipped the step of adding the resource to the browser scope in web/router.ex
:
resources "/videos", VideoController
Once that was done, the mix ecto.migrate
worked fine. 👍
Now getting:
== Compilation error on file web/views/video_view.ex ==
** (CompileError) web/views/video_view.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found
expanding macro: Rumbl.Web.__using__/1
web/views/video_view.ex:2: Rumbl.VideoView (module)
(elixir) expanding macro: Kernel.use/2
web/views/video_view.ex:2: Rumbl.VideoView (module)
(elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
or
== Compilation error on file web/views/session_view.ex ==
** (CompileError) web/views/session_view.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found
expanding macro: Rumbl.Web.__using__/1
web/views/session_view.ex:2: Rumbl.SessionView (module)
(elixir) expanding macro: Kernel.use/2
web/views/session_view.ex:2: Rumbl.SessionView (module)
(elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
Major PEBKAC ...!! (or unclear instructions in the book... but I prefer that I didn't read them fully...)
running mix ecto.migrate
too soon means that the DB table gets created before all code changes have been made ... that means you cannot run it again so compilation fails!!
Read through ALL the instructions on Pages 92 - 95 before running mix ecto.migrate
then it will all work fine. 👍
Totes works:
Added video:
on page 93 of Programming Phoenix we run
mix ecto.migrate
... we're seeing: