From 7fad60484220bb0e5a1796821a7bade726b81540 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Fri, 6 Oct 2017 13:09:33 -0400 Subject: [PATCH] Avoid show div into markup for answers' information If an answer does not contain any description or images associated, the "poll-more-info-answers" div won't be shown in the markup Change requested by #1998 --- app/views/polls/show.html.erb | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 1eb128333..e3405c0a8 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -66,29 +66,29 @@ -
-
+ <% @poll.questions.map(&:question_answers).flatten.each do |answer| %> + <% if answer.description.present? || answer.images.any? %> +
+
- <% @poll.questions.map(&:question_answers).flatten.each do |answer| %> -
+
- <% if answer.description.present? %> -

<%= answer.title %>

- <% end %> + <% if answer.description.present? %> +

<%= answer.title %>

- <% if answer.images.any? %> - <%= render "gallery", answer: answer %> - <% end %> +
+ <%= safe_html_with_links simple_format(answer.description) %> +
+ <% end %> - <% if answer.description.present? %> -
- <%= safe_html_with_links simple_format(answer.description) %> -
- <% end %> + <% if answer.images.any? %> + <%= render "gallery", answer: answer %> + <% end %> +
- <% end %> -
-
+
+ <% end %> + <% end %>