Thank you. That got me to the right point. It is now working.

In order to get rid of the spaces and get it into the right format, I
did have to change it to:
group.send(country.country.downcase.gsub(' ','_')) do |group|

On Jan 27, 3:54 am, vhochstein <[email protected]> wrote:
> Hi,
>
> Please try: group.send(country.country) do |group|
>
> --
> Volker
>
> On Jan 26, 8:27 pm, Jeff Surrett <[email protected]> wrote:
>
>
>
> > I am using the nested action groups available through the vhochstein/
> > active_scaffold fork. I had used it to create a quick select method to
> > be able to quickly filter the records based on the distinct values of
> > a column (state). It was working fine until I added records from other
> > countries (country column). I would like to have one level titles with
> > the country names and then the states would appear as the
> > action_links. Since it appears that the name of the group is derived
> > from the method (group.name), how do I get this to work. Here is what
> > I am trying:
>
> >     config.action_links.collection.select_by_state do |group|
> >         group.add 'select_by_state',
> >           :label=>"All",
> >           :type=>:collection,
> >           :page=>true,
> >           :inline=>false,
> >           :method=>:put,
> >           :parameters=>{:state=>'all'}
> >         Model.select("DISTINCT(country)").order(:country).each do |
> > country|
> > ***      group.country_name do |group|      # This is the line that I
> > do not know how to do
> >             Model.where(:country =>
> > country.country).select("DISTINCT(state)").order(:state).each do |
> > record|
> >               group.add 'select_by_state',
> >                 :label=>record.state,
> >                 :type=>:collection,
> >                 :page=>true,
> >                 :inline=>false,
> >                 :method=>:put,
> >                 :parameters=>{:state=>record.state}
> >             end
> >           end
> >         end
> >       end

-- 
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.

Reply via email to