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
1klap -
Rails Designer -
Rails Designer -
Pimp My Ruby -
Top comments (2)
Nice post! But You mistyped "dataset" π
Thank you! I fixed it π