Following code climate analysis, I found that my controllers are not DRY as it could be. The methods like:
def index @animals = current_user.animals.valid
You could use respond_with for these actions.
class AnimalController < ApplicationController respond_to :html, :json def index @animals = current_user.animals.valid_animals.search(params[:search], params[:page]) respond_with @animals end end