Project

General

Profile

unexist.dev

subtle

Assorted tidbits and projects

sorting views

Added by Emmet Brown almost 15 years ago

hi Christoph,
I have managed to install subtle on ubuntu (see another thread) and had already time to play with it. It looks really promising!
I have currently a question:
How can I specify the order of the views?
Here are my views in config:

134 #
135 # Views
136 #
137 VIEWS = {
138   "5.dev"  => "terms",
139   "4.talk" => "chats",
140   "3.work" => "editor",
141   "2.term" => "terms",
142   "1.web"  => "browser" 
143 }

But they are displayed in the next order: 2,1,3,5,4


Replies (2)

RE: sorting views - Added by Christoph Kappel almost 15 years ago

Hey Emmet,

actually this is a problem of ruby 1.8 - values in hashes don't keep the order - it's a known issue and finally fixed in 1.9. I know it's annoying..

RE: sorting views - Added by Christoph Kappel over 14 years ago

Starting with #1245 views can be sorted in this way:

VIEWS = [ { "foo" => "bar" }, { "bar" => "quuz" }
]

Thanks goes to jkramer for the patch. I actually don't wanted to make this, because ruby 1.9 already addresses that problem.

    (1-2/2)