Refactor js followable response.

This commit is contained in:
taitus
2017-07-05 14:01:17 +02:00
committed by Senén Rodero Rodríguez
parent b60748c552
commit 0c2be6a0d4
2 changed files with 5 additions and 1 deletions

View File

@@ -3,3 +3,6 @@ App.Followable =
initialize: -> initialize: ->
$('.followable-content a[data-toggle]').on 'click', (event) -> $('.followable-content a[data-toggle]').on 'click', (event) ->
event.preventDefault() event.preventDefault()
update: (followable_id, button) ->
$("#" + followable_id + " .js-follow").html(button)

View File

@@ -1 +1,2 @@
$("#<%= dom_id(@followable) %> .js-follow").html('<%= j render("followable_button", followable: @followable) %>'); App.Followable.update("<%= dom_id(@followable) %>",
"<%= j render('followable_button', followable: @followable) %>")