Files
grecia/app/components/polls/poll_component.rb
Javi Martín bb574db1ea Allow customizing the text to display poll dates
Since we were using `I18n.t`, our monkey-patch of the `t` helper wasn't
being applied.
2024-06-07 16:20:38 +02:00

15 lines
303 B
Ruby

class Polls::PollComponent < ApplicationComponent
attr_reader :poll
use_helpers :cannot?, :current_user, :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