From e61142382ec07a19faff53549cde2081dcb6a04e Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Fri, 31 Jul 2015 12:03:05 +0200 Subject: [PATCH] AutoCommit Fre Jul 31 12:03:05 CEST 2015 --- app/views/survey/questions/_answeredquestion.html.erb | 3 ++- app/views/survey/questions/_question.html.erb | 2 ++ app/views/survey/questions/show.html.erb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/survey/questions/_answeredquestion.html.erb b/app/views/survey/questions/_answeredquestion.html.erb index eacb56e..04a6a43 100644 --- a/app/views/survey/questions/_answeredquestion.html.erb +++ b/app/views/survey/questions/_answeredquestion.html.erb @@ -1,5 +1,6 @@ -
<%= answeredquestion.title%>
+
<%= answeredquestion.title%> +
    <% answeredquestion.choices.each do |c| %>
  • diff --git a/app/views/survey/questions/_question.html.erb b/app/views/survey/questions/_question.html.erb index 32b23f5..b40e1ae 100644 --- a/app/views/survey/questions/_question.html.erb +++ b/app/views/survey/questions/_question.html.erb @@ -7,5 +7,7 @@
  • <%= render c %>
  • <% end %>
+ <%= render partial: "answeredquestion", object: question if question.answers.where(user_id: current_user.id).count>0%> +
<% end %> diff --git a/app/views/survey/questions/show.html.erb b/app/views/survey/questions/show.html.erb index 237eb83..c37cd0e 100644 --- a/app/views/survey/questions/show.html.erb +++ b/app/views/survey/questions/show.html.erb @@ -18,7 +18,7 @@

<%= render @survey_question %> -<%= render partial: "answeredquestion", object: @survey_question %> +<% render partial: "answeredquestion", object: @survey_question %> <%= link_to 'Edit', edit_survey_question_path(@survey_question) %> | <%= link_to 'Back', survey_questions_path %>