I need to access my current users role in order to make sure they are an admin. If they are an admin I want to display the following link in my view.
<% if current_user.role =='admin' %>
<li class="manage">
<a href="#" id="manage" style="float:none;">
Manage
</a>
</li>
<% end %>
My problem is in the controller (below). How do I define @user so that it aligns with the current user? right now I am getting a "Couldn't find User without an ID" error
def index
@user = User.find(params[:id])
respond_to do |format|
format.html
end