# Using current\_page? With An Edit Route

**URL:** <https://www.ruby-forum.com/t/using-current-page-with-an-edit-route/180786>\
**Category:** Rails\
**Created:** [December 29, 2009, 4:17am UTC](https://www.ruby-forum.com/t/using-current-page-with-an-edit-route/180786 "2009-12-29T04:17:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaggotChild](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7ea924/32.png) [@MaggotChild](https://www.ruby-forum.com/u/MaggotChild)\
**Post date:** [December 29, 2009, 4:17am UTC](https://www.ruby-forum.com/t/using-current-page-with-an-edit-route/180786/1 "2009-12-29T04:17:46Z")

</div>

current\_page?(:action =\> ‘edit’, :controller =\> ‘admin/products’)  
fails with an ActionView::TemplateError (No route matches …) unless  
I’m in the edit action or I provide the :id.

Route:  
/admin/products/:id/edit(.:format) {:action =\> ‘edit’, :controller =\>  
‘admin/products’}

I understand why this happens, but is there a way to make  
current\_page? check for edit routes without specifying an id?

Thanks

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
