Reputation: 815
I've been looking at this for a while now, and I can't seem to find any open tags that ought to be closed. But I keep getting a rails syntax error, that says "expecting end-of-input". I've looked at all the tags and even broken it down on a sheet of paper, but I can't find any tag that should be closed which would cause this error. Is there something else that is wrong here, or did I miss something that is super simple?
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
</button>
<%= link_to "Professor Reviews", root_path, class: "navbar-brand" %>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<% # if user_signed_in? %>
<li><%= link_to "All Professors", professors_path %></li>
<li><%= link_to "New Professor", new_professor_path, class: "active" %></li>
<li><%= link_to "Account", edit_user_registration_path %></li>
<!-- <% else %>
<li><%= link_to "All Professors", professors_path %></li>
<li><%= link_to "Sign Up", new_user_registration_path, class: "active" %> </li>
<li><%= link_to "Sign In", new_user_session_path, class: "active" %></li>
<% end %> -->
</ul>
<%= form_tag search_professors_path, method: :get, class: "navbar-form navbar-right", role: "Search" do %>
<p>
<%= text_field_tag :search, params[:search], class: "form-control" %>
<%= submit_tag "Search", name: nil, class: "btn btn-default" %>
</p>
<% end %>
</div>
</div>
</nav>
Upvotes: 0
Views: 66
Reputation: 4413
The html commented code is run..
So the error is in <!-- <% else %>
because the <% # if ...
is not run.
Upvotes: 1