<%= content_tag :button, 'Previous', :id => "looking_for_prev", :disabled => !(@records.current_page > 1 && @records.current_page - 1) %> <%= content_tag :button, 'Search' , :id => "looking_for_find" %> <%= content_tag :button, 'Next' , :id => "looking_for_next", :disabled => !(@records.current_page < @records.total_pages && @records.current_page + 1) %> <%= hidden_field_tag "page", @records.current_page %>