You are welcome!

El 15/01/13 10:13, tonym escribió:

Thankyou! for such a quick reply.  That's exactly what I was looking for.

Cheers, Anthony.


On Tuesday, January 15, 2013 6:29:51 AM UTC, Ignacio Huerta wrote:

    Hi,

    When passing custom options to select_menu I usually use "map". Try
    this
    and see if it works:

    <select-menu name="category" selected='&selected' first-option="All
    Categories" options="&Category.all.map{|category|
    [category.name <http://category.name>, category.id
    <http://category.id>]}"" />

    There's also an old post discussing something similar:
    https://groups.google.com/forum/#!topic/hobousers/yIz5I7k3Zoo
    <https://groups.google.com/forum/#!topic/hobousers/yIz5I7k3Zoo>

    Regards,
    Ignacio

    El 15/01/13 00:38, tonym escribiďż˝:
     > Hi All,
     > Been scratching my head over this one for a while.
     > I'm using a select menu as a set of filters.  nothing special, just
     > passing them as params...
     >
     > <def tag="searchform">
     >    <form class="filter-menu searchform" action="/categories/"
    method="GET" >
     >      <select-menu name="category" selected='&selected'
    first-option="All
     > Categories" options="&Category.all" />
     >      <select-menu name="area" selected='&selected'
     > first-option="Anywhere In Sheffield" options="&LocalArea.all" />
     >      <select-menu name="day" selected='&selected'
     > options="&day_filter_options" />
     >      <button type="submit" id="main_srch"
    class="btn">Search</button>
     >    </form>
     > </def>
     >
     > Problem is, the select menu /values/ are being populated with the
    name
     > string, not the model's id.
     > Works perfectly for the hash pairs I've built for the
     > day_filter_options, but not for the models.
     >
     > Any help would be greatly appreciated.
     >
     > Cheers, Anthony.
     >
     > --
     > You received this message because you are subscribed to the Google
     > Groups "Hobo Users" group.
     > To view this discussion on the web visit
     > https://groups.google.com/d/msg/hobousers/-/dhlNUczdtesJ
    <https://groups.google.com/d/msg/hobousers/-/dhlNUczdtesJ>.
     > To post to this group, send email to [email protected]
    <javascript:>.
     > To unsubscribe from this group, send email to
     > [email protected] <javascript:>.
     > For more options, visit this group at
     > http://groups.google.com/group/hobousers?hl=en
    <http://groups.google.com/group/hobousers?hl=en>.

    --
    Ignacio Huerta Arteche
    http://www.ihuerta.net
    Tel�fono: 0034 645 70 77 35
    Email realizado con software libre

--
You received this message because you are subscribed to the Google
Groups "Hobo Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/hobousers/-/Jf892m31XS8J.
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.

--
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre

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