Files
nairobi/app/components/polls/poll_component.rb
Javi Martín b2a49cd291 Extract component to render the status of a poll
We're renaming the existing HTML class in order to be consistent with
the name of the component.
2025-08-22 12:13:41 +02:00

15 lines
278 B
Ruby

class Polls::PollComponent < ApplicationComponent
attr_reader :poll
use_helpers :link_to_poll
def initialize(poll)
@poll = poll
end
private
def dates
t("polls.dates", open_at: l(poll.starts_at.to_date), closed_at: l(poll.ends_at.to_date))
end
end