そこで、メニューの「プロフィール」フィールドをユーザーの名前に変更しようとしています。
<li><%= link_to "Profile", "#" %></li>
だから私はそれを
<li><%= link_to User.name, "#" %></li>
しかし、メニューには、ユーザー名ではなく「ユーザー」と表示されます。
解決策はありますか?
ありがとうございました

そこで、メニューの「プロフィール」フィールドをユーザーの名前に変更しようとしています。
<li><%= link_to "Profile", "#" %></li>
だから私はそれを
<li><%= link_to User.name, "#" %></li>
しかし、メニューには、ユーザー名ではなく「ユーザー」と表示されます。
解決策はありますか?
ありがとうございました

Assuming you get your currently logged in user via current_user method, it should be:
<li><%= link_to current_user.name, '#' %></li>
What you are doing now is sending name message to User class instead of User instance. Since User class doesn't have name method defined, you get this error.