# ActiveScaffold behavior modification

**URL:** <https://www.ruby-forum.com/t/activescaffold-behavior-modification/128950>\
**Category:** Rails\
**Created:** [February 12, 2008, 10:43pm UTC](https://www.ruby-forum.com/t/activescaffold-behavior-modification/128950 "2008-02-12T22:43:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![agilehack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Post date:** [February 12, 2008, 10:43pm UTC](https://www.ruby-forum.com/t/activescaffold-behavior-modification/128950/1 "2008-02-12T22:43:13Z")

</div>

I have a small project running using ActiveScaffold sucesfully. As my  
next step I would like to modify things such that after a search is  
executed if the result is one record skip directly to the show of the  
record (show method?) and not the results screen normaly seen. Of  
course if the result is more than 1 record after searching (as is  
normal) then the default behavior can continue. Has anyone done  
this? Is it as simple as an ‘if’ statement and a redirect?

---

<div class="post-metadata">

**Author:** ![agilehack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Post date:** [February 13, 2008, 9:00pm UTC](https://www.ruby-forum.com/t/activescaffold-behavior-modification/128950/2 "2008-02-13T21:00:43Z")

</div>

Has anyone tackled this before?

---

<div class="post-metadata">

**Author:** ![agilehack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d2c977/32.png) [@agilehack](https://www.ruby-forum.com/u/agilehack)\
**Post date:** [February 15, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/activescaffold-behavior-modification/128950/3 "2008-02-15T15:50:54Z")

</div>

have you tried writing an index method that does the find, checks the  
result.

If there is only one result, set this into a singular @object\_name and  
then render show,  
or possibly setup params and then do a redirect

I have done a little with ActiveScaffold and that is how where I would  
start, but I may be wide of the mark

Tonypm
