<def attrs='param-name, options, no-filter, id' tag='filter-menu'>
  <% no_filter ||= "All" %>
  <form class='filter-menu' action='&request.request_uri' method='get'
merge-attrs='id'>
    <div>
      <% selected = options.detect {|o|
o.to_s==params[param_name.gsub('-', '_')] } %>
      <select-menu name='&param_name' options='&options'
selected='&selected' merge-params first-option='&no_filter'/>
    </div>
  </form>
</def>

That's the source of filter menu.  quick fix is to copy it and write
your own tag for it but replace the <% selected = ... %> line to work
for your input.

On Jun 22, 5:44 pm, Togg <[email protected]> wrote:
> I already saw that there were problems reported with filter-menu in
> the past, but I couldn't find a fix for my problem (lighthouse #314,
> #369, #725).
> When I use a hash to fill the filter-menu, the filtering itself works,
> but the determination of the selected item does not. Using an array
> works, but then I cant use different values and names.
>
> in the dryml:
>     <filter-menu param-name="show" options="&@myvar"/>
>
> In the controller:
> Array:
>     @myvar = ["1 Minute", "5 Minutes"]
>
> Hash:
>     @myvar = {"1 Minute" => 60, "5 Minutes" => 300}
>
> The problem seems to be the code in rapid_plus.dryml, line 166:
>     <% selected = options.detect {|o|
> o.to_s==params[param_name.gsub('-', '_')] } %>
>
> For the hash it concatenates the option -- o.to_s would be "5
> Minutes300" for example.
>
> Any idea for a bugfix?
>
> Thanks,
> Sebastian

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