Fix label in form to add own answer
The label text was always in English, and it wasn't associated with any
input field.
The `SecureRandom` part is a quick hack so we don't get duplicate IDs.
Using "your_answer_#{question.id}" might work as well, but right now I'm
not sure if the form is sometimes rendered twice for the same question.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<%= form_tag(create_answer_question_path(question, token: token), method: :post, remote: true) do %>
|
||||
<label> You can add your own answer</label>
|
||||
<input type="text" class="medium-10" name="answer">
|
||||
<input class="button success" type="submit" value="<%= t("poll_questions.show.add_answer") %>">
|
||||
<% id = "your_answer_#{SecureRandom.hex}" %>
|
||||
<%= label_tag :answer, t("poll_questions.show.your_answer"), for: id %>
|
||||
<%= text_field_tag :answer, nil, class: "medium-10", id: id %>
|
||||
<%= submit_tag t("poll_questions.show.add_answer"), class: "button success" %>
|
||||
<% end %>
|
||||
|
||||
@@ -701,6 +701,7 @@ en:
|
||||
show:
|
||||
vote_answer: "Vote %{answer}"
|
||||
voted: "You have voted %{answer}"
|
||||
your_answer: "You can add your own answer"
|
||||
add_answer: "Add answer"
|
||||
description:
|
||||
multiple: "You can select a maximum of %{maximum} answers."
|
||||
|
||||
@@ -699,6 +699,7 @@ es:
|
||||
show:
|
||||
vote_answer: "Votar %{answer}"
|
||||
voted: "Has votado %{answer}"
|
||||
your_answer: "Puedes añadir tu propia respuesta"
|
||||
add_answer: "Añadir respuesta"
|
||||
description:
|
||||
multiple: "Puedes seleccionar un máximo de %{maximum} respuestas."
|
||||
|
||||
Reference in New Issue
Block a user