小编Big*_*igL的帖子

link_to first name and last name as one link

I have the first name and last name which both link to the users profile:

= link_to (@post.user.fname), user_path(@post.user_id) 
= link_to (@post.user.lname), user_path(@post.user_id)
Run Code Online (Sandbox Code Playgroud)

These are two separate links. When I hover the mouse over the first name it only highlights the first name. And vice versa. (Example is just a randomly generated name)

How do I make the first name and last name one single link_to so it underlines the full name?

enter image description here

ruby ruby-on-rails hyperlink link-to

0
推荐指数
1
解决办法
509
查看次数

标签 统计

hyperlink ×1

link-to ×1

ruby ×1

ruby-on-rails ×1