Extract Polls::QuestionComponent
This commit is contained in:
7
app/components/polls/questions/question_component.rb
Normal file
7
app/components/polls/questions/question_component.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Polls::Questions::QuestionComponent < ApplicationComponent
|
||||
attr_reader :question
|
||||
|
||||
def initialize(question:)
|
||||
@question = question
|
||||
end
|
||||
end
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user