Created
January 28, 2014 09:07
-
-
Save ryaz/8664401 to your computer and use it in GitHub Desktop.
Remote destroy for actve admin index (table)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdminRemoteDestroyable | |
def self.included(dsl) | |
dsl.controller do | |
def destroy | |
destroy! do |format| | |
format.html | |
format.js {render js: %Q|$("tr##{resource.class.model_name.singular}_#{resource.id}").fadeOut();|} | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment