Since we've renamed the class to `Option`, having variables, methods and texts refering to it as `answer` was confusing.
14 lines
318 B
Ruby
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
|