Active Scaffold List Filter plugin

165 views
Skip to first unread message

Tys von Gaza

unread,
Feb 28, 2008, 8:06:50 PM2/28/08
to ActiveScaffold : Ruby on Rails plugin
So the Active Scaffold Export plugin gave me inspiration to create a
filter plugin. It is about time I gave back a bit.

I've designed this plugin so the type of filter is open to the user.
Right now it just includes a filter where you pass in an association
and out spits a list of checkboxes with the associated values. The
sky is the limit here though, not much stopping someone from creating
a filter with a map and when you click the map it finds all rows that
are within 100km's of that point, or an iTunes style browser, etc.

Feedback, updates and bug fixes welcome.
http://code.google.com/p/activescaffoldlistfilters/

Cheers,
Tys

Tys von Gaza

unread,
Feb 28, 2008, 8:11:33 PM2/28/08
to ActiveScaffold : Ruby on Rails plugin
For those curious, here it is in action:
http://activescaffoldlistfilters.googlecode.com/files/Picture%201.png

Tys

Tys von Gaza

unread,
Mar 8, 2008, 4:07:51 PM3/8/08
to ActiveScaffold : Ruby on Rails plugin
I've refactored the way filters work. I've used the PluginFactory
library to auto load the filters as mixin's with the ListFilter data
structure. This allows for a lot more flexibility on what you can do
with a filter.

I've also updated the association filter to allow for the association
to be more then one level deep. Ie, your scaffold is on the model
User and you want to filter on User.phone.carrier, you can pass in an
array to your filter's option hash, ie:

config.list_filter.add(:association, :district, {:label =>
"Carrier", :association => [ :phone, :carrier ] })

Hoping to get a map based filter working later today.

Tys

rob

unread,
Apr 3, 2008, 4:23:20 AM4/3/08
to ActiveScaffold : Ruby on Rails plugin
Tys,

I'm keen to use this plugin but am having problems. I logged an issue
on your project page.


Thanks,

nicolae.claudius

unread,
Apr 3, 2008, 1:02:37 PM4/3/08
to ActiveScaffold : Ruby on Rails plugin
this should work with habtm associations too.

nicolae.claudius

unread,
Apr 3, 2008, 1:03:36 PM4/3/08
to ActiveScaffold : Ruby on Rails plugin
It wold be great if it wold work with habtm associations also!

Tys von Gaza

unread,
Apr 3, 2008, 1:19:44 PM4/3/08
to ActiveScaffold : Ruby on Rails plugin
Hey Nicolae,

Unfortunately I'm super busy with work right now and can't take a
closer look at getting habtm associations working. However it
shouldn't be too difficult to play around with it and see if you could
get it working.

Take a look at these files:
frontends/default/views/_association.rhtml
lib/list_filters/association.rb

The view partial to display the options probably doesn't have to be
changed much. The association list filter might need some tweaking to
the conditions method.

Submit a patch if you get something working.

Tys


On Apr 3, 11:03 am, "nicolae.claudius" <claudius.nico...@gmail.com>
wrote:

Tys von Gaza

unread,
Apr 3, 2008, 1:19:59 PM4/3/08
to ActiveScaffold : Ruby on Rails plugin
Replied on the issue page.

Tys

Tys von Gaza

unread,
Apr 8, 2008, 3:13:30 PM4/8/08
to ActiveScaffold : Ruby on Rails plugin
This issue should be fixed now, let me know if anything else comes up.

Tys

forrestc

unread,
Apr 9, 2008, 10:58:19 AM4/9/08
to ActiveScaffold : Ruby on Rails plugin
Great work, Tys!

BTW, is the application in your sample screenshot packaged with
something like Fluid?

Tys von Gaza

unread,
Apr 9, 2008, 3:30:14 PM4/9/08
to ActiveScaffold : Ruby on Rails plugin
Thanks.

The app can be, but it is still running off a remote server, not
locally.

Tys
Reply all
Reply to author
Forward
0 new messages