Extract component for organization actions
We remove duplication by doing so, and now we only need to add the call do render Admin::TableActionsComponent once.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
class Admin::Organizations::TableActionsComponent < ApplicationComponent
|
||||
delegate :can?, to: :controller
|
||||
attr_reader :organization
|
||||
|
||||
def initialize(organization)
|
||||
@organization = organization
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def can_verify?
|
||||
can? :verify, organization
|
||||
end
|
||||
|
||||
def can_reject?
|
||||
can? :reject, organization
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user