Skip to content

Commit

Permalink
Updated to work with Phoenix 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zanderxyz committed Jan 16, 2019
1 parent 6a65aba commit 9c22a03
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/mix/tasks/veil/add.ex
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ defmodule Mix.Tasks.Veil.Add do
previous = File.read!(layout_path)
layout_data = File.read!(layout_source)

to_replace = "<a href=\"http://www.phoenixframework.org/docs\">Get Started</a>"
to_replace = "<a href=\"https://hexdocs.pm/phoenix/overview.html\">Get Started</a>"

if String.contains?(previous, to_replace) do
File.write!(layout_path, String.replace(previous, to_replace, layout_data))
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Veil.MixProject do
use Mix.Project

@version "0.2.1"
@version "0.2.2"

def project do
[
Expand Down
4 changes: 2 additions & 2 deletions priv/templates/lib/web/controllers/veil/session_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule <%= web_module %>.Veil.SessionController do
<%= if html? do %>
conn
|> put_resp_cookie("session_unique_id", session.unique_id, max_age: 60*60*24*365)
|> redirect(to: page_path(conn, :index))
|> redirect(to: Routes.page_path(conn, :index))
<% else %>
conn
|> render("show.json", session: session)
Expand All @@ -37,7 +37,7 @@ defmodule <%= web_module %>.Veil.SessionController do
<%= if html? do %>
conn
|> delete_resp_cookie("session_unique_id", max_age: 60*60*24*365)
|> redirect(to: user_path(conn, :new))
|> redirect(to: Routes.user_path(conn, :new))
<% else %>
conn
|> render("ok.json")
Expand Down
4 changes: 2 additions & 2 deletions priv/templates/lib/web/templates/layout/app.html.eex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<%= if veil_user_id = assigns[:veil_user_id] do %>
Authenticated as <%= veil_user_id %>
<a href="<%= session_path(@conn, :delete, @session_unique_id) %>">Sign out</a>
<a href="<%= Routes.session_path(@conn, :delete, @session_unique_id) %>">Sign out</a>
<% else %>
<a href="<%= user_path(@conn, :new) %>">Sign in</a>
<a href="<%= Routes.user_path(@conn, :new) %>">Sign in</a>
<% end %>
2 changes: 1 addition & 1 deletion priv/templates/lib/web/templates/veil/user/new.html.eex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h2>Sign In</h2>

<%%= render "form.html", changeset: @changeset, action: user_path(@conn, :create) %>
<%%= render "form.html", changeset: @changeset, action: Routes.user_path(@conn, :create) %>

0 comments on commit 9c22a03

Please sign in to comment.