No commit activity in last 3 years
No release in over 3 years
Make easy create simple search formss.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
 Project Readme

EasySearchForm

Introduction

When i was creating search form i get bored because this is a very repetitive task, and because that i start to create this gem, this first version is the very basic but by now this is enough, and i will improve this, and if you have some suggestion please let me know this.

How to install

Add this line to your application's Gemfile:

gem 'easy_search_form'

And then execute:

$ bundle

Or install it yourself as:

$ gem install easy_search_form

Example

Migrations

  create_table :products do |t|
    t.string :description, :null => false
    t.integer :size, :null => false
  end

Models

  class Product < ActiveRecord::Base
    # :equals tell the plugin to use "=" in SQL instead LIKE that is the default.
    acts_as_searchable :description, :size => :equals
  end

Controller

  def index
    # Replace the all for search and pass the param if the param is null it will return all.
    @users = User.search params[:query] 
  end  

View

  # Put the search_form when you want to print the search form.
  <%= search_form %> 

Contact

if you need help contanct me: bfscordeiro (at) gmail.com

Copyright (c) 2010 Bruno Cordeiro, released under the MIT license

License

The gem is available as open source under the terms of the MIT License.