From 21f2467f45a3037ac89f8849c746b30780ab7e16 Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 25 Jul 2015 23:18:27 +0530 Subject: [PATCH] Fix question pagination --- app/views/shared/_question.html.haml | 1 + app/views/user/questions.js.erb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_question.html.haml b/app/views/shared/_question.html.haml index 393fad72..4e7717c3 100644 --- a/app/views/shared/_question.html.haml +++ b/app/views/shared/_question.html.haml @@ -1,3 +1,4 @@ +- type ||= nil .panel.panel-default.questionbox{data: { id: q.id }} .panel-body .media diff --git a/app/views/user/questions.js.erb b/app/views/user/questions.js.erb index 01344836..a27fddb8 100644 --- a/app/views/user/questions.js.erb +++ b/app/views/user/questions.js.erb @@ -1,8 +1,8 @@ $('#questions').append('<% @questions.each do |q| - %><%= j render 'shared/question', q: q + %><%= j render 'shared/question', q: q, type: nil %><% end %>'); <% if @questions.next_page %> $('#pagination').html('<%= j will_paginate @questions, renderer: BootstrapPagination::Rails, page_links: false %>'); <% else %> $('#pagination, #load-more-btn').remove(); -<% end %> \ No newline at end of file +<% end %>