Is there a built in variable for the current path?

Probably a silly question, but I'm trying to create a partial that I
use in two seperate resources... one is called Tickets and one is

I have links at the top of the page that order my seatrch by passing a
parameter into the ticket_path() variable...

Now I'd like to change that to the current path so that in
TicketsSearch I can use the same parameter and it would be like

tickets_search_path( :order => date ) instead of ticket_path( :order
=> date ) w/o having to create an if statements and have two blocks of
table headers....

I hope that makes sense. Here's my table header view if it helps.


oops... I was messing around trying stuff in that last pastie, I
forgot to fix it...

so ignore that base_path variable, or just look here...

thanks :slight_smile:

Ok I figured it out.... after trying 100 different things...

url_for() does the trick for me.

request.request_uri returns the entire path including current query
strings, which I don't want... nad I can't pass t new query strings,
but url_for allows you to pass it an action, controller and
query_strings, and if you leave the action or controller out, it uses
the current one, which is perfect :slight_smile: now if I'm on the search, I get

and if I'm on the ticket listing... I get

sweet! :slight_smile:

( just posting here for google achieving :slight_smile: )

if you were using restful routing, just prefix the route with _url rather than _path: