Link_to > logged_in_user.username

Hi there…

A newbie question…

The link below links to the users-page…that works fine…

  • <%= link_to 'MyLink', user_path(logged_in_user) -%>
  • But i don’t want the link ‘Mylink’ but the username instead of. The
    username is stored in logged_in_user.username

    How can i realize…this…

    swoany

    Remco S. wrote:

  • <%= link_to 'MyLink', user_path(logged_in_user) -%>
  • But i don’t want the link ‘Mylink’ but the username instead of. The
    username is stored in logged_in_user.username

    <%= link_to logged_in_user.username, user_path(logged_id_user) -%>

    Lutz

    Lutz H. wrote:

    Remco S. wrote:

  • <%= link_to 'MyLink', user_path(logged_in_user) -%>
  • But i don’t want the link ‘Mylink’ but the username instead of. The
    username is stored in logged_in_user.username

    <%= link_to logged_in_user.username, user_path(logged_id_user) -%>

    Lutz

    Hi Lutz…thanks!!

    Hi,

    Remco S. wrote:

    Lutz H. wrote:

    <%= link_to logged_in_user.username, user_path(logged_id_user) -%>

    Take a look at

    for more details of the link_to helper.

    Lutz