Extract Polls::QuestionComponent

This commit is contained in:
Senén Rodero Rodríguez
2022-08-31 17:28:33 +02:00
parent df65ba57cc
commit 7efd7c89ef
3 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
class Polls::Questions::QuestionComponent < ApplicationComponent
attr_reader :question
def initialize(question:)
@question = question
end
end

View File

@@ -31,9 +31,7 @@
<% end %>
<% end %>
<% @questions.each do |question| %>
<%= render "polls/questions/question", question: question %>
<% end %>
<%= render Polls::Questions::QuestionComponent.with_collection(@questions) %>
</div>
</div>