Wes Gamble wrote: > All, > > Rails 2.1 > AS 2.1 > > I have an AS model (MedicalFacility) that HABTM another AS model > (MedicalFacilityCategory). > > If I put the following into my medical_facilities_controller: > > config.columns[:medical_facility_categories].search_sql = > "medical_facility_categories.category" > config.search.columns << :medical_facility_categories > > does this just enhance the search field to also search the "text" of > medical_facility_categories.category? > > If I want to basically provide a dropdown of categories and then do a > textual search on medical facilities within the context of a given > category, will I need to customize both the search partial, and the SQL > that gets executed on the server in? > This turned out to be quite trivial. I already had conditions_for_collection set up to take advantage of the search scope that I wanted, so all I had to do was copy the _search.rhtml partial into my particular controller directory and add my select_tag, appropriately named, of course, and it just worked!
The bottom line is that search just piggybacks on the filtering options that are provided via conditions for collection so you can just do it that way and handle it. Wes --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
