Skip to content

tracersoft/searchbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Searchbox

INSTALL

Gemfile

gem 'searchbox', github: 'tracersoft/searchbox'

GETTING STARTED

class DummySearch < Searchbox::Search
  klass Dummy #scopes will execute in the class context

  scope :fulltext, -> (text) {
    search_by_name(text) # sameas Dummy.search_by_name(text)
  }

  scope :search_by_name

  fields :email, :name #active-record only

  is :active # if is:active is in the query, will execute the method: Dummy.active
  has :attachment, -> {
  }

  in :trash, -> {
  }
end

will parse

email: [email protected] is:active Fulltextsearch

About

Simplify search without bloating your controller/model

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages