Show HN: A gem to stop progressively building ActiveRecord queries
github.com
github.com
<form>
<input type='text' name='email' value='<%= params[:email] %>' />
</form>
Which works out nicely, since the method defaults to 'GET' and the action defaults to the current path.In case you want to replicate, I believe the relevant part is simply adding this to the base class:
extend ActiveModel::Naming
include ActiveModel::AttributeMethods
def to_key
[]
end
And then add `attr_reader` for each field.If we're checking boxes, two features that Filterer has and has_scope doesn't are:
- results ordering
- pagination (although most folks will already be using kaminari or will_paginate)
Correct me if I am wrong.