Files
grecia/app/components/polls/questions/question_component.rb
Javi Martín 8997ed316c Rename variables describing poll options as answers
Since we've renamed the class to `Option`, having variables, methods and
texts refering to it as `answer` was confusing.
2024-06-13 19:13:05 +02:00

14 lines
318 B
Ruby

class Polls::Questions::QuestionComponent < ApplicationComponent
attr_reader :question
def initialize(question:)
@question = question
end
def options_read_more_links
safe_join(question.options_with_read_more.map do |option|
link_to option.title, "#answer_#{option.id}"
end, ", ")
end
end