Skip to content

Commit

Permalink
Add location header to gen.json create action
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmuskala committed Aug 31, 2015
1 parent 53a4b56 commit 725f7ca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions priv/templates/phoenix.gen.json/controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ defmodule <%= module %>Controller do
{:ok, <%= singular %>} ->
conn
|> put_status(:created)
|> put_resp_header("location", <%= singular %>_path(conn, :show, <%= singular %>))
|> render("show.json", <%= singular %>: <%= singular %>)
{:error, changeset} ->
conn
Expand Down

0 comments on commit 725f7ca

Please sign in to comment.