Permalink
Browse files

added hello controller and views

  • Loading branch information...
kidooom committed Oct 6, 2015
1 parent d068fd3 commit 801f9039014d4d629dafbf5772826ff73140ebbe
Showing with 12 additions and 0 deletions.
  1. +7 −0 web/controllers/hello_controller.ex
  2. +1 −0 web/router.ex
  3. +1 −0 web/templates/hello/index.html.eex
  4. +3 −0 web/views/hello_view.ex
@@ -0,0 +1,7 @@
defmodule PhoenixTraining.HelloController do
use PhoenixTraining.Web, :controller
def index(conn, _params) do
conn |> render "index.html", text: "Hello from Controller"
end
end
View
@@ -17,6 +17,7 @@ defmodule PhoenixTraining.Router do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
get "/hello", HelloController, :index
end
# Other scopes may use custom stacks.
@@ -0,0 +1 @@
<h1><%= @text %></h1>
View
@@ -0,0 +1,3 @@
defmodule PhoenixTraining.HelloView do
use PhoenixTraining.Web, :view
end

0 comments on commit 801f903

Please sign in to comment.