# Passing a named\_scope through a named\_route

**URL:** <https://www.ruby-forum.com/t/passing-a-named-scope-through-a-named-route/175931>\
**Category:** Rails\
**Created:** [September 23, 2009, 12:29am UTC](https://www.ruby-forum.com/t/passing-a-named-scope-through-a-named-route/175931 "2009-09-23T00:29:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5e9695/32.png) [@Bob\_O](https://www.ruby-forum.com/u/Bob_O)\
**Post date:** [September 23, 2009, 12:29am UTC](https://www.ruby-forum.com/t/passing-a-named-scope-through-a-named-route/175931/1 "2009-09-23T00:29:50Z")

</div>

I know i can pass a hash to a named\_route, but how do i filter.

example

i have a bookings\_controller and i want to filter the index lists  
based on which link is clicked.

so something like  
\<%= link\_to “Current Bookings”, bookings\_path(@current\_bookings) %\>

@current\_bookings is set to Booking.current\_bookings

and i have a named\_scope  
named\_scope :current\_bookings, :conditions =\> [‘departure\_date \<= ?’,  
Date.today]

and i want to do something similar with archived\_bookings and  
canceled\_bookings all using the same index view, but the data is  
filtered based on the link that has been clicked

is this possible, and if so how?
