From Rails
<%= link_to(
'likeπ',
'#',
id: 'like',
data: {
userId: current_user.id
})
%>
To JS
$('#like').click(function(event){
console.log(event.target.dataset.userId)
})
For further actions, you may consider blocking this person and/or reporting abuse
JesΓΊsB -
keploy -
Aarav Joshi -
keploy -
Top comments (2)
Nice post! But You mistyped "dataset" π
Thank you! I fixed it π