Reputation: 125
i'm not able to create a link without the href attribute with link_to
<a class="some-class" title="some-title"></a>
i was searching in some documentation but i haven't seen anything related to this problem.
FYI this type of link is provided to have a clickable item with the title attribute and without the classic '#' in the url. i'm open to other solutions to the problem.
Any suggestion?
Upvotes: 2
Views: 2219
Reputation: 754
Each link should have href
attribute.
You could set href
to #
like this:
<%= link_to "#", class: "some-class", title: "some-title" do %>
Whatever
<% end %>
Upvotes: 1
Reputation: 309
You should check out the Tag Helper.
This should do the trick:
<%= tag "a", :class => "some_class", :title => "some_title"%>
Upvotes: 2
Reputation: 5622
you can just type it directly in the view
<a class="some-class" title="some-title"></a>
the link_to helper is used to get the baseurl
Upvotes: 1