# Active scaffold config question

**URL:** <https://www.ruby-forum.com/t/active-scaffold-config-question/128509>\
**Category:** Rails\
**Created:** [February 8, 2008, 8:18am UTC](https://www.ruby-forum.com/t/active-scaffold-config-question/128509 "2008-02-08T08:18:02Z")\
**Posts on this page:** 5\
**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 8, 2008, 8:18am UTC](https://www.ruby-forum.com/t/active-scaffold-config-question/128509/1 "2008-02-08T08:18:02Z")

</div>

i am using active scaffold and have a question on the search. I  
changed the default full text search to a field search successfully  
with this in my controller:

config.actions.exclude :search  
config.actions \<\< :field\_search

my problem is this defaults to all feilds in the search screen, I only  
want to allow user to search on 3 or 4, does anyone know how to  
configure for this?

---

<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 8, 2008, 9:00am UTC](https://www.ruby-forum.com/t/active-scaffold-config-question/128509/2 "2008-02-08T09:00:59Z")

</div>

Hi,

I use ActiveScaffold a lot but haven’t needed to modify the search  
conditions (so I haven’t tried this myself). A quick look at this  
page…

[http://activescaffold.com/docs/api-search](http://activescaffold.com/docs/api-search)

…seems to indicate that you can modify the search columns like this:

config.search.columns \<\< :roles

Even more cool is that it says that you can search across the  
associations as well.

Good luck!

Chris

---

<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, 5:11am UTC](https://www.ruby-forum.com/t/active-scaffold-config-question/128509/3 "2008-02-12T05:11:12Z")

</div>

does anyone else have any input on this? I think he is onto something  
but no matter what I do in the model or controller - no luck. my  
search is still defaulting to all the columns in the table whereas I  
would like to just choose about 4. HELP

---

<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 26, 2008, 11:20pm UTC](https://www.ruby-forum.com/t/active-scaffold-config-question/128509/4 "2008-02-26T23:20:23Z")

</div>

config.actions \<\< :field\_search  
config.field\_search.columns = [:foo, :bar]

like that?

---

<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 28, 2008, 2:25am UTC](https://www.ruby-forum.com/t/active-scaffold-config-question/128509/5 "2008-02-28T02:25:39Z")

</div>

that worked man!! thanks a ton. thanks to all of you.
