Hashes in Ruby do not keep the insertion order, you should do it like this:

<%= select_tag :module, options_for_select( [ ['All',''], ['Evidence'
, 1], ['Assets', 2], ['Inventory', 3], ['Water' , 4], ['Laboratory' ,
5], ['State EPA', 6], ['Administrator', 7]]), :style => "width:206px",
:id => :indexselect %>

On Wed, Sep 24, 2008 at 10:41 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> I have built a select_tag dropdown to represent a group of selections
> that will feed a model-query routine I've written.
> This routine works fine but the order of the items is different than
> what I programmed. My objection to this order is that I want the 'All
> => ''' to be on the top.
> Here it is;
>
>        <tr>
>          <td><strong><%= "User Module" %></strong></td>
>          <td>    <%= select_tag(:module, options_for_select('All' =>
> '', 'Evidence' => 1, 'Assets' => 2, 'Inventory' => 3, 'Water' => 4,
> 'Laboratory' => 5, 'State EPA' => 6, 'Administrator' => 7), :style =>
> "width:206px", :id => :indexselect) %> </td>
>        </tr>
>
> and here is the order of items as they 'drop down' on the form.
>
> Laboratory
> All
> Administrator
> Assets
> Water
> Evidence
> Inventory
> State EPA
>
> I am grateful for any suggestions.
> Kathleen
> >
>



-- 
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
João Pessoa, PB, +55 83 8867-7208

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to