# Help with routes

**URL:** <https://www.ruby-forum.com/t/help-with-routes/194450>\
**Category:** Rails\
**Created:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/help-with-routes/194450 "2010-09-06T16:39:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zurich\_by\_night](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/d78d45/32.png) [@zurich\_by\_night](https://www.ruby-forum.com/u/zurich_by_night)\
**Post date:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/help-with-routes/194450/1 "2010-09-06T16:39:27Z")

</div>

In my view, I’ve got the following condition:

\<% if current\_page? :controller =\> ‘deals’, :action =\> ‘foobar’ %\>  
woot  
\<% end %\>

My route looks like:

map.fobar ‘/:city.:format’, :controller =\> ‘deals’, :action =\>  
‘foobar’, :defaults =\> { :format =\> ‘html’ }

However, the conditions succeeds if I do:

\<%= active\_if { current\_page? :controller =\> ‘deals’, :action =\>  
‘todays\_deal’, :format =\> ‘html’ } %\>

Why do I need to pass :format =\> ‘html’?

On another page I have:

route: map.resources :deals

\<%= if current\_page? :controller =\> ‘deals’, :action =\> ‘index’ %\>,  
without :format =\> ‘html’, the condition also succeeds.

So why is it failing with deals#foobar ?
