I have the following code:
<div class="category_name">
<%= current_user %>
<%= review.user.front_name %>
<% if current_user.name = review.user.front_name %>
<%= link_to "You", user_path(review.user) %> / <%= review.categories_list %>
<% else %>
<%= link_to review.user.front_name, user_path(review.user) %> / <%= review.categories_list %>
<% end %>
</div>
It renders something like:
Tom Murphy Bill Smith You / Films
Why is this happening?
<% if current_user.name = review.user.front_name %>
In other words, if Tom Murphy = Bill Smith...which it doesn't...shouldn't it go to the line AFTER the 'else'? That's what I want to happen.
=instead of==. You are assigning instead of comparing