-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Environment
- Elixir & Erlang versions (elixir --version): 1.3.4 & 19.2
- Operating system: ubuntu
Current behavior
I have an .eex
partial for my phoenix application. It has an <%= cond do %>
at the first line and raises unpredictable web/templates/layout/_header_user_menu.html.eex:1: expected -> clauses for do in cond
:
** (CompileError) web/templates/layout/_header_user_menu.html.eex:1: expected -> clauses for do in cond
(stdlib) lists.erl:1354: :lists.mapfoldl/3
(stdlib) lists.erl:1354: :lists.mapfoldl/3
(stdlib) lists.erl:1355: :lists.mapfoldl/3
(stdlib) lists.erl:1354: :lists.mapfoldl/3
(stdlib) lists.erl:1355: :lists.mapfoldl/3
My code is:
<%= cond do %>
<% is_nil(assigns[:current_user]) -> %>
<!-- doens't matter -->
<% @current_user.state != "lack_of_credentials" -> %>
<!-- doesn't matter -->
<% true -> %>
<!-- nothing -->
<% end %>
Is it a bug or feature?
benonymus and josephan