I have a table that looks like this:

Each row is from this partial:
<div class="row chord-table-row" id= <%= "chord-#{chord.id}" %>>
<div class="small-1 columns"><%= chord.id %></div>
<div class="small-2 columns"><%= chord.name %></div>
<div class="small-3 columns"><%= chord.description %></div>
<div class="small-3 columns"><%= chord.user.username %></div>
<div class="small-3 columns"><%= link_to 'Approve', approve_path, class: 'chord-approval-button' %></div>
</div>
How can I make the 'Approve' button go to the approve action in the chords_controller, which will update the state field of the Chord, and then run the JS/Coffeescript in approve.js.coffee?
I would (ideally) like to use remote: true in the 'Approve' link, but I am not sure how to ensure that the controller knows which Chord is being approved.
Right now the #approve action looks like this:
def approve
chord.approve
# this method is on the Chord model and is working
respond_to do |format|
format.js
end
end
I'd like to do this in the right "rails" way, so any guidance/advice would be much appreciated! Thanks!