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 %>