Module: DeleteableActions
- Included in:
- MailManager::ContactsController, MailManager::MailingListsController, MailManager::MailingsController
- Defined in:
- lib/deleteable.rb
Instance Method Summary collapse
- #delete ⇒ Object
- #destroy ⇒ Object
-
#undelete ⇒ Object
:nocov: - not currently supported.
Instance Method Details
#delete ⇒ Object
31 32 33 |
# File 'lib/deleteable.rb', line 31 def delete destroy end |
#destroy ⇒ Object
35 36 37 38 39 40 |
# File 'lib/deleteable.rb', line 35 def destroy thing = self.class.name.gsub(/s?Controller$/,'').constantize.find(params[:id]) thing.delete flash[:info] = "#{thing.class.name.gsub(/^.*::/,'').humanize} successfully deleted." redirect_to(action: :index) end |
#undelete ⇒ Object
:nocov: - not currently supported
43 44 45 46 47 |
# File 'lib/deleteable.rb', line 43 def undelete thing = self.class.name.gsub(/s?Controller$/,'').constantize.find(params[:id]) thing.undelete redirect_to(action: :index) end |