Last active
August 29, 2015 14:03
-
-
Save dgoldie/c7227a05cd8f9ce739a3 to your computer and use it in GitHub Desktop.
second view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Phoenix.Template.UndefinedError) No such template "start.html" | |
Stacktrace | |
(thor) lib/thor/views/pages.ex:1: Thor.Views.Pages.render/2 | |
(phoenix) lib/phoenix/controller.ex:132: Phoenix.Controller.render_view/5 | |
(thor) lib/thor/router.ex:1: anonymous fn/1 in Thor.Router.call/2 | |
(phoenix) lib/phoenix/plugs/error_handler.ex:9: Phoenix.Plugs.ErrorHandler.wrap/3 | |
(plug) lib/plug/adapters/cowboy/handler.ex:7: Plug.Adapters.Cowboy.Handler.init/3 | |
(cowboy) src/cowboy_handler.erl:64: :cowboy_handler.handler_init/4 | |
(cowboy) src/cowboy_protocol.erl:435: :cowboy_protocol.execute/4 | |
defmodule Thor.Controllers.Pages do | |
use Phoenix.Controller | |
def index(conn, _params) do | |
render conn, "index" | |
end | |
def start(conn, params) do | |
IO.puts "start action: #{inspect params}" | |
render conn, "start" | |
end | |
def test(conn, %{"id" => id}) do | |
IO.puts "id = #{ id}" | |
render conn, "test", results: "test results: #{id}" | |
end | |
end | |
defmodule Thor.Router do | |
use Phoenix.Router | |
plug Plug.Static, at: "/static", from: :thor | |
get "/", Thor.Controllers.Pages, :index, as: :page | |
get "/start", Thor.Controllers.Pages, :start, as: :start | |
get "/test/:id", Thor.Controllers.Pages, :test, as: :test | |
end | |
2.1.2 apollo:~/code/work/fbrain/thor/lib/thor/templates | |
$ ls pages | |
index.html.eex start.html.eex test.html.eex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you tried restarting your router? Newly added templates do have an issue of getting picked up currently.