Skip to content

Commit

Permalink
add dwyl controller for test, #36
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonLab committed Dec 22, 2018
1 parent a0ffdc5 commit 8d11bb6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
defmodule TestAutoformWeb.DoWhatYouLoveController do
use TestAutoformWeb, :controller
use Autoform

alias TestAutoform.DoWhatYouLove

def new(conn, _params) do
changeset = DoWhatYouLove.changeset(%DoWhatYouLove{}, %{})

render_autoform(conn, :create, DoWhatYouLove, assigns: [changeset: changeset])
end

end
1 change: 1 addition & 0 deletions test/support/test_autoform/lib/test_autoform_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ defmodule TestAutoformWeb.Router do
resources("/sample_products", SampleProductController)
get("/custom_no_path", CustomController, :new_no_path)
get("/custom_new_product", CustomController, :new_product)
resources("/do_what_you_love", DoWhatYouLoveController)
end

# Other scopes may use custom stacks.
Expand Down

0 comments on commit 8d11bb6

Please sign in to comment.