Deleting answers was not even possible. But it was possible to delete questions. So we implemented the same behavior.
15 lines
295 B
Ruby
15 lines
295 B
Ruby
class Admin::Poll::Questions::Answers::TableActionsComponent < ApplicationComponent
|
|
attr_reader :answer
|
|
delegate :can?, to: :helpers
|
|
|
|
def initialize(answer)
|
|
@answer = answer
|
|
end
|
|
|
|
private
|
|
|
|
def actions
|
|
[:edit, :destroy].select { |action| can?(action, answer) }
|
|
end
|
|
end
|