Skip to content

Commit

Permalink
Credit where credit is due. Thanks @radar!
Browse files Browse the repository at this point in the history
  • Loading branch information
ernie committed Mar 29, 2012
1 parent fc8151a commit 82d2a80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ greatly from MetaSearch, and _backwards compatibility is not a design goal._
Ransack enables the creation of both simple and [advanced](http://ransack-demo.heroku.com)
search forms against your application's models. If you're looking for something that
simplifies query generation at the model or controller layer, you're probably not looking
for Ransack (or MetaSearch, for that matter). Try
for Ransack (or MetaSearch, for that matter). Try
[Squeel](http://metautonomo.us/projects/squeel) instead.

## Getting started
Expand Down Expand Up @@ -49,7 +49,7 @@ requires very little setup effort.
If you're coming from MetaSearch, things to note:

1. The default param key for search params is now `:q`, instead of `:search`. This is
primarily to shorten query strings, though advanced queries (below) will still
primarily to shorten query strings, though advanced queries (below) will still
run afoul of URL length limits in most browsers and require a switch to HTTP
POST requests.
2. `form_for` is now `search_form_for`, and validates that a Ransack::Search object
Expand All @@ -59,7 +59,7 @@ If you're coming from MetaSearch, things to note:
the ActiveRecord adapter) via a call to `Search#result`. If passed `:distinct => true`,
`result` will generate a `SELECT DISTINCT` to avoid returning duplicate rows, even if
conditions on a join would otherwise result in some.

Please note that for many databases, a sort on an associated table's columns will
result in invalid SQL with `:distinct => true` -- in those cases, you're on your own,
and will need to modify the result as needed to allow these queries to work. Thankfully,
Expand All @@ -85,7 +85,7 @@ In your view:

`cont` (contains) and `start` (starts with) are just two of the available search predicates.
See Constants for a full list.

### Advanced Mode

"Advanced" searches (ab)use Rails' nested attributes functionality in order to generate
Expand All @@ -108,10 +108,10 @@ This means you'll need to tweak your routes...
index
render :index
end

... and update your `search_form_for` line in the view ...

<%= search_form_for @q, :url => search_people_path,
<%= search_form_for @q, :url => search_people_path,
:html => {:method => :post} do |f| %>

Once you've done so, you can make use of the helpers in Ransack::Helpers::FormBuilder to
Expand All @@ -122,16 +122,13 @@ construct much more complex search forms, such as the one on the

## Contributions

If you'd like to support the continued development of Ransack, please consider
[making a donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=48Q9HY64L3TWA).

To support the project in other ways:
To support the project:

* Use Ransack in your apps, and let me know if you encounter anything that's broken or missing.
* Use Ransack in your apps, and let us know if you encounter anything that's broken or missing.
A failing spec is awesome. A pull request is even better!
* Spread the word on Twitter, Facebook, and elsewhere if Ransack's been useful to you. The more
people who are using the project, the quicker we can find and fix bugs!

## Copyright

Copyright &copy; 2011 [Ernie Miller](http://twitter.com/erniemiller)
Copyright &copy; 2011 [Ernie Miller](http://twitter.com/erniemiller)
6 changes: 3 additions & 3 deletions ransack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Gem::Specification.new do |s|
s.name = "ransack"
s.version = Ransack::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Ernie Miller"]
s.email = ["ernie@metautonomo.us"]
s.homepage = "http://metautonomo.us/projects/ransack"
s.authors = ["Ernie Miller", "Ryan Bigg"]
s.email = ["ernie@erniemiller.org", "[email protected]"]
s.homepage = "http://erniemiller.org/projects/ransack"
s.summary = %q{Object-based searching for ActiveRecord (currently).}
s.description = %q{Ransack is the successor to the MetaSearch gem. It improves and expands upon MetaSearch's functionality, but does not have a 100%-compatible API.}

Expand Down

0 comments on commit 82d2a80

Please sign in to comment.