Files
grecia/app/components/admin/poll/questions/answers/table_actions_component.rb
Julian Herrero 3a6e99cb8c Don't allow changing answers if the poll has started
Just like we did with questions.
2022-09-20 17:50:49 +02:00

15 lines
285 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].select { |action| can?(action, answer) }
end
end