Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%= form_for [@child, @answer] do |f| %>
- <% @parent.questions.each_with_index do |question, i| %>
- <p>(Q<%= i + 1 %>) <%= question.text %>
- <%= f.hidden_field :question_id, :value => question.id, :index => "index#{i}" %>
- <label><%= f.radio_button :answer, 0, :index => "index#{i}" %>A</label>
- <label><%= f.radio_button :answer, 1, :index => "index#{i}" %>B</label>
- <label><%= f.radio_button :answer, 2, :index => "index#{i}" %>C</label>
- <label><%= f.radio_button :answer, 3, :index => "index#{i}" %>D</label>
- </p>
- <% end %>
- <%= f.submit "SEND" %>
- <% end %>
- Parameters: {"utf8"=>"✓", "authenticity_token"=>"9y96VdvAbs...", "answer"=>{"index0"=>{"question_id"=>"135", "answer"=>"3"}, "index1"=>{"question_id"=>"136", "answer"=>"1"}, "index2"=>{"question_id"=>"137", "answer"=>"1"}}, "commit"=>"SEND", "child_id"=>"480"}
- Unpermitted parameters: index0, index1, index2
- (0.2ms) BEGIN
- SQL (0.2ms) INSERT INTO `answers` (`child_id`, `created_at`, `updated_at`) VALUES (480, '2017-07-20 19:36:31', '2017-07-20 19:36:31')
- (1.0ms) COMMIT
- Unpermitted parameters: index0, index1, index2
- (0.1ms) BEGIN
- SQL (0.2ms) INSERT INTO `answers` (`child_id`, `created_at`, `updated_at`) VALUES (480, '2017-07-20 19:36:31', '2017-07-20 19:36:31')
- (0.3ms) COMMIT
- Unpermitted parameters: index0, index1, index2
- (0.1ms) BEGIN
- SQL (0.3ms) INSERT INTO `answers` (`child_id`, `created_at`, `updated_at`) VALUES (480, '2017-07-20 19:36:31', '2017-07-20 19:36:31')
- (0.3ms) COMMIT
- Child Load (0.2ms) SELECT `children`.* FROM `children` WHERE `children`.`id` = 480 LIMIT 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement