Skip to content

Instantly share code, notes, and snippets.

@ryaz
Created January 28, 2014 09:07
Show Gist options
  • Save ryaz/8664401 to your computer and use it in GitHub Desktop.
Save ryaz/8664401 to your computer and use it in GitHub Desktop.
Remote destroy for actve admin index (table)
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