# \[routes\] resources with new actions

**URL:** <https://www.ruby-forum.com/t/routes-resources-with-new-actions/111954>\
**Category:** Rails\
**Created:** [August 13, 2007, 8:26pm UTC](https://www.ruby-forum.com/t/routes-resources-with-new-actions/111954 "2007-08-13T20:26:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfsog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Post date:** [August 13, 2007, 8:26pm UTC](https://www.ruby-forum.com/t/routes-resources-with-new-actions/111954/1 "2007-08-13T20:26:10Z")

</div>

I’m building a ticketing program and I’m trying to get the following  
routes:

tickets/all  
tickets/sorted  
tickets/unsorted

cat/1/tickets/1  
cat/1/tickets/all  
cat/1/tickets/sorted  
cat/1/tickets/unsorted

currently my routes are:

map.resources :tickets  
map.resources :categories do | category |  
category.resources :tickets, :name\_prefix =\> ‘cat\_’  
end

1. tickets should be filtered by status or also with category  
-status is a boolean value in the tickets table

2. status should retain when changing between categories  
-I was thinking of instead of passing around a get for status to store  
it instead in a session

Can I get the desired results using resources?  
Should I have three actions for the status in my tickets controller?  
(all, sorted, unsorted)

Is it possible to call sorted set a session, then call index?

map.resources :tickets, :collection { :all =\> :get, :unsorted =\> :get  
,:sorted =\> :get }

\<%= link\_to ‘Sorted’, sorted\_tickets\_path %\>

def sorted

# set session call index and render index.rtrml

end

tickets/sorted

I’ve been scratching my head on this one for a while.  
Any suggestions?
