Created
February 7, 2012 19:12
-
-
Save ehoch/1761304 to your computer and use it in GitHub Desktop.
Spam Action on the Fly
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
config.actions do | |
member :spam do | |
link_icon 'icon-ban-circle' | |
bulkable? { true } | |
controller do | |
Proc.new do | |
if params[:bulk_ids] | |
params[:bulk_ids].each {|id| @abstract_model.model.find(id).spam } | |
flash[:success] = "#{params[:bulk_ids].size} Spammed" | |
else | |
@object.spam | |
flash[:success] = "Deleted and Marked as spam." | |
end | |
redirect_to back_or_index | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment