Presenting data in 2 styles - 2 action/views or 1?

Hi I want to present a list of ingredients in an A - Z format and also
offer a by category format as well in my ingredients index.
E.g.

A

apple apricot blahblah blahblah
blah blah blah blah

B

and by category

Fruit
apple apricot blahblah blahblah
blah blah blah blah

Vegetables

There are a lot of tutorials that use a table with clickable headers but
I dont want this format. I trying to think how i can present these
without creating a lot of code in my index view

will i need to create two seperate action and views for the index?

Im also looking for a non java solution. Any pointers, tips?

sorry i meant “Im looking for a non AJAX solution”

Adam A. wrote:

Hi I want to present a list of ingredients in an A - Z format and also
offer a by category format as well in my ingredients index.
[…]
will i need to create two seperate action and views for the index?

No. Just pass a URL parameter that specifies the sort order.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs