I should be able to figure this out but perhaps I am brain dead...
I simply want to display the next id in sequence for a few 'categories'.
My view template is very basic...
<% for next_seq in @next_seq %> <%= next_seq[0] %> - <%= next_seq[1] %><br /> <% end %>
and I want them sorted in next_seq[0] order and since @next_seq is a hash, it displays in a rather random order.
Not that this should matter, but the controller code for this looks like this...
@lib_cat = Valuelist.find(:all, :conditions => ["list_name = 'Library Categories'"], :order => 'list_value') @next_seq = Hash.new for lib_cat in @lib_cat @next_seq[lib_cat.list_value] = Library.find(:first, :conditions => ['ltype = ?', lib_cat.list_value], :order => 'id DESC').id + 1 end
I'm not doing a 'select' so I can't do the normal collect_for_selection thingy
Craig