Updated with pagination code and gem and fixed form elements