I am looking for some advice on best practice. I want to create a
tabbed view of the database. To give an idea, it should look something
Let say I have a table called product with about 3000 different
products. I want a tabbed box, like the above, with tabs such as:
'abc' 'def' 'ghi'....'xyz'
Each tab will contain products structured by alphabetical order. So if
I click on abc, it will return a list of all products that begins with
a or b or c.
Now my questions:
Performance wise, would you go for a SQL call per tab (select * from
product where name is like 'a' or name is like 'b' or name is like
'c') OR a general select * and then programatically build up the
I was thinking about using Iframe as in the tab demo. so each inline
page would be abc.rhtml which would contain a call to a helper which
would build the values from a specific sql call (for a b c and not
select the entire product table). I beleive it is the easiest.
Would you agree?
If not from a find_all how would you build the table - I have some
ideas but would love some 'best practice' exemple?