Skip to content

Instantly share code, notes, and snippets.

@mfifth
Created January 22, 2025 21:18
Show Gist options
  • Save mfifth/9076fbb49b33d4c8363e46114fdfaa68 to your computer and use it in GitHub Desktop.
Save mfifth/9076fbb49b33d4c8363e46114fdfaa68 to your computer and use it in GitHub Desktop.
<div class='main-container'>
<%= form_tag('/surveys', method: :post) do %>
<%= label_tag 'question' %>
<%= text_field_tag :question %>
<%= submit_tag 'Submit' %>
<% end %>
<div class='existing-surveys'>
<% @surveys.each do |survey| %>
<h2> <%= survey.question %> </h2>
<div class="survey-answers" id="survey-#{survey.id}">
<%= form_tag('/create_answer', data: {type: "script"}, multipart: true, local: false, remote: true, method: :post) do %>
<%= label_tag "Do you agree?" %>
<%= radio_button_tag :agree, true, 'checked' %>
<%= label_tag "Do you disagree?" %>
<%= radio_button_tag :agree, false, 'checked' %>
<%= hidden_field_tag :survey_id, survey.id %>
<%= submit_tag 'Submit' %>
<% end %>
</div>
<% end %>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment