Added pagination using will_paginate gem adding code into controllers and view files.