Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

Karina's Profile

GitHub User: kvargasmoura

Comments by Karina

Avatar

You can use:

ruby
  def self.search(search)
    if search
      #case insensitive
      where('email ILIKE ?', "%#{search}%")
    else
      scoped
    end
  end