On May 19, 2010, at 12:00 PM, Bryan Larsen wrote:

Hobo uses Rails' options_for_select to do its heavy lifting.  If you
patch rails with
https://rails.lighthouseapp.com/projects/8994/tickets/1986-create-optgroups-in-options_for_select ,
you'll get the desired behaviour.

Note that the rails patch was produced by our resident expert Matt
Jones.   It's too bad they rejected the patch.  :(


A bummer indeed, although Pratik's comment is reasonable - options_for_select does tons of stuff already.

Another option would be to patch select-menu so that it used
grouped_options_for_select instead of options_for_select when
appropriate.   I'm not exactly sure what the interface should be --
perhaps if options were passed in via a "grouped-options" attribute
rather than "options".   If you create such a patch, I'd love to add
it to Hobo.

The third option (which I actually have used) is to punt - at it's core, filter-menu is *not* a terribly complicated tag. All it is (minus some of the defaulting, parameter merging, etc) is:

<form action="&request.request_uri" method="get" class="filter-menu">
  <div>
    ...a select menu, generated by *some* means, lives here...
  </div>
</form>

Not exactly a complicated tag. The unobtrusive scripts in hobo- rapid.js take care of wiring up the select menu -> form submit stuff (as long as the filter-menu class is there).

--Matt Jones

--
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to