Regardiung 11. Filters


#1

Hey, I have a question about 11. Filters. Not so much needing help, as I've passed it.

It says to put the following code here:

"app/views/layouts/application.html.erb, within

on line 21 add:"

<% if current_user %> 
  <ul> 
    <li><%= current_user.email %></li> 
    <li><%= link_to "Log out", logout_path, method: "delete" %></li> 
  </ul> 
<% else %> 
  <ul> 
    <li><%= link_to "Login", 'login' %></a></li> 
    <li><%= link_to "Signup", 'signup' %></a></li> 
  </ul> 
<% end %>

Notice the < / a >'s in

 <li><%= link_to "Login", 'login' %></a></li> 
    <li><%= link_to "Signup", 'signup' %></a></li>

What is the purpose of those < / a >'s? There is no beginning .


#2

@kvy I have no idea why they're there. They aren't in my code, and they don't belong there, since <%= link_to %> renders the full <a> tag, with a closing tag, so you shouldn't need to add that yourself.

You should be able to remove the closing <a> tags and not have any issues, since they don't belong there.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.