Thanks for the comment. I did consider changing List Filter to :type => :collection but that would require changes at multiple places. I might still do this to keep AS clean.
Zac On Mar 23, 4:00 pm, "Sergio Cambra .:: entreCables S.L. ::." <[email protected]> wrote: > On Martes, 23 de Marzo de 2010 15:08:31ZacZhengescribió: > > > > > I've managed to get the list filters to display after much digging > > around. It's a bit hacky at the moment but I thought I'd post it here > > in case it might help. > > > The problem is to do with how List Filter's action_link is stored, if > > it was done correctly it would have shown in the _list_headers > > partial. > > > Assuming you've copied AS's views to app/views/ > > active_scaffold_overrides, open _list_header.html.erb. Add the > > following before the 'each :collection' line: > > > <% active_scaffold_config.action_links.each :table do |link| -%> > > <%= render_action_link(link, new_params) -%> > > <% end -%> > > > List Filter's link is being stored as :table so the above is needed to > > display it. Now because :table is not recognised in ActiveScaffold for > > 'position' purposes, a small change needs to be made. > > > In the ActiveScaffold plugin open lib/active_scaffold/data_structures/ > > action_link.rb. Go to line 131 and add: > > return :top if self.type == :table > > > The List Filter icon in the shape of a filter should show now. I am > > still getting errors when actually filtering which I'm going going to > > look at now. > > Or, instead of so many changes, change list_filters plugin to use :type => > :collection instead of :type => :table. Anyway :type => :table should work > with rails-2.3 branch and you should get a deprecation warning in log file. > > > > >Zac > > > On Mar 22, 2:04 pm,ZacZheng<[email protected]> wrote: > > > I am having the same problem. > > > > It's been installed and configured according to the documentation, but > > > nothing shows. It doesn't seem this plugin has been worked on since > > > 2008 and must have fallen out-of-date with ActiveScaffold. > > > > Did you have any luck with getting this to work? I'm going to poke > > > around the source code to see if I can find a fix. > > > >Zac > > > > On Mar 12, 12:47 am, steveb <[email protected]> wrote: > > > > My very simple schema. States <-- Institutions --> > > > > Accreditations > > > > > My models: > > > > > class State < ActiveRecord::Base > > > > has_many :institutions > > > > end > > > > > class Accreditation < ActiveRecord::Base > > > > has_many :institutions > > > > end > > > > > class Institution < ActiveRecord::Base > > > > belongs_to :state > > > > belongs_to :accreditation > > > > end > > > > > My controllers: > > > > > class AccreditationsController < ApplicationController > > > > active_scaffold :accreditations > > > > end > > > > > class StatesController < ApplicationController > > > > active_scaffold :states > > > > end > > > > > class InstitutionsController < ApplicationController > > > > active_scaffold :institutions do |config| > > > > config.actions.add :list_filter > > > > config.list_filter.add(:association, :accreditation, { :label => > > > > "Accreditations", :association => :accreditation }) > > > > end > > > > end > > > > > I've also tried: > > > > > class InstitutionsController < ApplicationController > > > > active_scaffold :institutions do |config| > > > > config.actions.add :list_filter > > > > config.list_filter.add(:association, :accreditation) > > > > end > > > > end > > > > > My problem: Nothing shows up, nolistfilter, no errors, nothing! When > > > > I loadhttp://localhost:3000/institutions, nolistfilters appear > > > > above thelistof institutions. Everything else works fine. The plugin > > > > installed without errors. > > > > > $ script/plugin install > > > > git://github.com/tvongaza/active_scaffold_list_filters.git Initialized > > > > empty Git repository in ...../rr_01/vendor/plugins/ > > > > active_scaffold_list_filters/.git/ > > > > remote: Counting objects: 75, done. > > > > remote: Compressing objects: 100% (64/64), done. > > > > remote: Total 75 (delta 14), reused 17 (delta 2) > > > > Unpacking objects: 100% (75/75), done. > > > > From git://github.com/tvongaza/active_scaffold_list_filters > > > > * branch HEAD -> FETCH_HEAD > > > > > Arrrrgh. Can someone please help? Thanks! > > -- > Sergio Cambra .:: entreCables S.L. ::. > Mariana Pineda 23, 50.018 Zaragoza > T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
