Created
July 7, 2014 22:42
-
-
Save batwicket/87688fcbbac23f4dbf72 to your computer and use it in GitHub Desktop.
proto router.ex for phoenixframework
This file contains 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 Ws.Router do | |
use Phoenix.Router | |
plug Plug.Static, at: "/static", from: :ws | |
get "/users/", Ws.Controllers.Users, :show, as: :page | |
# put "/users/", Ws.Controllers.Users, :update | |
post "/users/", Ws.Controllers.Users, :create | |
delete "/users/", Ws.Controllers.Users, :destroy | |
get "/users/:user", Ws.Controllers.Users, :show, as: :page | |
put "/users/:user", Ws.Controllers.Users, :update, as: :page | |
post "/users/", Ws.Controllers.Users, :create | |
delete "/users/:user", Ws.Controllers.Users, :destroy, as: :page | |
resources "users", Controllers.Users do | |
resources "comments", Controllers.Comments | |
end | |
scope path: "admin", alias: Controllers.Admin, helper: "admin" do | |
resources "users", Users | |
end | |
end |
hmm.. ok.. so with the resources entry how can i hook up the controller to handle the 7 different REST cases?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should be identical to what you want: