Skip to content

Commit

Permalink
added hello controller and views
Browse files Browse the repository at this point in the history
  • Loading branch information
kidooom committed Oct 6, 2015
1 parent d068fd3 commit 801f903
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web/controllers/hello_controller.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
1 change: 1 addition & 0 deletions web/router.ex
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions web/templates/hello/index.html.eex
@@ -0,0 +1 @@
<h1><%= @text %></h1>
3 changes: 3 additions & 0 deletions web/views/hello_view.ex
@@ -0,0 +1,3 @@
defmodule PhoenixTraining.HelloView do
use PhoenixTraining.Web, :view
end

0 comments on commit 801f903

Please sign in to comment.