Created
May 13, 2015 17:57
-
-
Save kriben/53c096a2679bee105e49 to your computer and use it in GitHub Desktop.
Nested resources in phoenix
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
defmodule HelloPhoenix.Router do | |
use HelloPhoenix.Web, :router | |
pipeline :browser do | |
plug :accepts, ["html"] | |
plug :fetch_session | |
plug :fetch_flash | |
plug :protect_from_forgery | |
end | |
pipeline :api do | |
plug :accepts, ["json"] | |
end | |
scope "/", HelloPhoenix do | |
pipe_through :browser # Use the default browser stack | |
get "/", PageController, :index | |
resources "/users", UserController | |
resources "/categories", CategoryController do | |
resources "/items", ItemsController | |
end | |
end | |
# Other scopes may use custom stacks. # scope "/api", HelloPhoenix do # pipe_through :api # end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hio