Reputation: 6259
I have an link_to in my view:
<%= link_to "#{g.nummer} #{g.bezeichnung}", icd_test_path(g, :number => "JQUERY"), remote: true, :class => "tests" %>
What i would like to do is to have the content of id="nummer" as parameter :number in the link_to :
<a id="number">12<a>
Jquery would look something like this:
$(#number).html()
How can i do this?
Upvotes: 0
Views: 127
Reputation: 15089
Just put an :id => 'number'
inside the link_to
:
<%= link_to "#{g.nummer} #{g.bezeichnung}",
icd_test_path(g, :number => "JQUERY"),
remote: true,
:class => "tests",
:id => 'number' %>
Upvotes: 1