Add component to render the form poll
Right now it just renders the questions as it used to.
This commit is contained in:
1
app/components/polls/form_component.html.erb
Normal file
1
app/components/polls/form_component.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render Polls::Questions::QuestionComponent.with_collection(questions) %>
|
||||
7
app/components/polls/form_component.rb
Normal file
7
app/components/polls/form_component.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Polls::FormComponent < ApplicationComponent
|
||||
attr_reader :questions
|
||||
|
||||
def initialize(questions)
|
||||
@questions = questions
|
||||
end
|
||||
end
|
||||
@@ -31,7 +31,7 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= render Polls::Questions::QuestionComponent.with_collection(@questions) %>
|
||||
<%= render Polls::FormComponent.new(@questions) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user