westman2222
westman2222

Reputation: 683

Display alternate link text in RUBY ON Rails

I am looking to have this link show as "Click Here". Right now it just shows the URL. How can I change the label of this hyperlink?

  <%= link_to @post.external_url, @post.external_url, class: "btn btn-default btn-xs" %>

Upvotes: 0

Views: 335

Answers (1)

Prakash Murthy
Prakash Murthy

Reputation: 13067

<%= link_to "Click Here", @post.external_url, class: "btn btn-default btn-xs" %>

See the documentation for link_to helper for more info about how to use it.

Upvotes: 1

Related Questions