Use App.Comments module in create.js.erb
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
|
||||
App.Comments =
|
||||
|
||||
add_response: (parent_id, response_html) ->
|
||||
$(response_html).insertAfter($("#js-comment-form-#{parent_id}"))
|
||||
|
||||
reset_and_hide_form: (id) ->
|
||||
form = $("#js-comment-form-#{id}")
|
||||
form.val('')
|
||||
form.hide()
|
||||
|
||||
toggle_form: (id) ->
|
||||
$("#js-comment-form-#{id}").toggle()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user