diff --git a/app/components/polls/form_component.html.erb b/app/components/polls/form_component.html.erb new file mode 100644 index 000000000..bd1704133 --- /dev/null +++ b/app/components/polls/form_component.html.erb @@ -0,0 +1 @@ +<%= render Polls::Questions::QuestionComponent.with_collection(questions) %> diff --git a/app/components/polls/form_component.rb b/app/components/polls/form_component.rb new file mode 100644 index 000000000..0a2bc5668 --- /dev/null +++ b/app/components/polls/form_component.rb @@ -0,0 +1,7 @@ +class Polls::FormComponent < ApplicationComponent + attr_reader :questions + + def initialize(questions) + @questions = questions + end +end diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index f90679a9d..3feae7f1e 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -31,7 +31,7 @@ <% end %> <% end %> - <%= render Polls::Questions::QuestionComponent.with_collection(@questions) %> + <%= render Polls::FormComponent.new(@questions) %>