[Ruby] new_#{controller}_path

shaners becker veganstraightedge at gmail.com
Sun Feb 18 18:00:38 PST 2007


i have a partial that has a link_to to has a named route. but i call  
this partial from multiple controllers so i need to make the named  
path a little more dynamic.

"new_#{controller}_path" gives me, as you would imagine:

http://mysite.com/new_orders_path
http://mysite.com/new_subscriptions_path
and so on

how do make a named path do this?

-sb




-----------
join the resistance. fall in love.
http://theresistancearmy.com/




More information about the Ruby mailing list