Not sure what’s wrong. I’ve tried removing the space between the < and % but the app wouldn’t run.
< % if logged_in? %>
Welcome < %= current_user.username %>! Not you?
< %= link_to "Log out", logout_path %>
< % else %>
< %= link_to "Sign up", signup_path %> or
< %= link_to "log in", login_path %>.
< % end %>
The error I get is:
NoMethodError in Posts#index undefined method `logged_in?' for #<#<Class:0x00000101ab0250>:0x00000101aab0c0>

Did you mean :
Your current piece of code will try to use the logged_in? helper wich i guess is not what you want.