I’m trying to have 2 different scopes, one
"/" and the other one
"/admin". Admin scope uses
MovieTheater.Admin, so I have created a
MovieTheather.MovieController and a
MovieTheater.Admin.MovieController. my admin scope also has to be
as: :admin to prevent errors with my
"/" scope, that way I can use
admin_movie_path and also, should be able to use
movie_path but it doesn’t work.
It just says
function MovieTheater.MovieView.render/2 is undefined (module MovieTheater.MovieView is not available)
But I have created the view:
defmodule MovieTheater.MovieView do use MovieTheater.Web, :view end
These are my routes
scope "/admin", MovieTheater.Admin, as: :admin do pipe_through [:browser, :browser_session, :auth, :current_user] get "/dashboard", PageController, :dashboard resources "/movies", MovieController end scope "/", MovieTheater do pipe_through [:browser, :current_user] get "/", PageController, :index resources "/users", UserController, only: [:new, :create] resources "/sessions", SessionController, only: [:new, :create, :delete] resources "/movies", MovieController, only: [:index, :show] end
What could be wrong?
Thanks for your help.