# ActiveScaffold - Search route doesn't work with REST

**URL:** <https://www.ruby-forum.com/t/activescaffold-search-route-doesnt-work-with-rest/126977>\
**Category:** Rails\
**Created:** [January 23, 2008, 10:06pm UTC](https://www.ruby-forum.com/t/activescaffold-search-route-doesnt-work-with-rest/126977 "2008-01-23T22:06:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sazima](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/43a26b/32.png) [@Sazima](https://www.ruby-forum.com/u/Sazima)\
**Post date:** [January 23, 2008, 10:06pm UTC](https://www.ruby-forum.com/t/activescaffold-search-route-doesnt-work-with-rest/126977/1 "2008-01-23T22:06:21Z")

</div>

Another one with ActiveScaffold. Am I doing something wrong? Is my  
workaround correct?

Cheers, Sazima

* * *

What steps will reproduce the problem?

1. Create RESTful application (script/generate scaffold user)
2. Install/use ActiveScaffold
3. Click on “Search”

What is the expected output? What do you see instead?  
Search field. Instead there is an error because the REST route to the  
“user”  
resource has higher priority in routes.rb than common routes):

ActiveRecord::RecordNotFound (Couldn’t find User with ID=show\_search)

I had to move the ERST route to the end of the file to get the search  
feature to work…

What version (or revision) of the product are you using?  
1.1.1 with Rails 2.0.2 (InstantRails2 installation)

---

<div class="post-metadata">

**Author:** ![Sazima](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/43a26b/32.png) [@Sazima](https://www.ruby-forum.com/u/Sazima)\
**Post date:** [January 26, 2008, 7:08am UTC](https://www.ruby-forum.com/t/activescaffold-search-route-doesnt-work-with-rest/126977/2 "2008-01-26T07:08:46Z")

</div>

Sazima wrote:

> I had to move the ERST route to the end of the file to get the search  
> feature to work…

If you enable active\_scaffold on your REST routes, you don’t have to  
reorder anything

Ex.

map.resources :candidates, :active\_scaffold =\> true

Hope this helps,

Chris

---

<div class="post-metadata">

**Author:** ![Sazima](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/43a26b/32.png) [@Sazima](https://www.ruby-forum.com/u/Sazima)\
**Post date:** [April 10, 2008, 7:23pm UTC](https://www.ruby-forum.com/t/activescaffold-search-route-doesnt-work-with-rest/126977/3 "2008-04-10T19:23:23Z")

</div>

This helped me out. Thanks Chris!

` Chuck

On Jan 26, 2:08 am, Chris M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
