-1

I have this button that displays a link. The link is difficult to highlight and copy when on mobile devices. I want to make the link a button that redirects you when clicked

**      <%= link_to 'Reply Link', '#', class: "cursor-pointer inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:shadow-outline-indigo focus:border-indigo-700 active:bg-indigo-700 transition duration-150 ease-in-out", "@click" => "showReplyLink = true; return false " %>

**

Eyeslandic
  • 14,553
  • 13
  • 41
  • 54

2 Answers2

0

I would try to use CSS to make a link as button. If You use bootstrap You can add classes: btn btn-primary or write Your own for instance add class button: and write css like here How to create an HTML button that acts like a link

a.button {
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;

    text-decoration: none;
    color: initial;
}
0

The second argument to link_to is the path or URL that you want to link to. Replace the '#' argument with the URL that you want to redirect to

David
  • 168
  • 2
  • 5