On Jueves, 1 de Octubre de 2009 15:18:22 Esfera escribió: > Well, I'm wasn't able to do the override. > Followed the "instructions" on the site and they were simply ignored > by the application. > Detected another problem though.
I will ask it again. Have you tried field_search? You shouldn't need to override anything with field_search. > > One of the fields I'm searching in, is obviously, a timestamp field. > > when I do something like "config.search.columns = > [:first_name,:last_name,created_at]" and submit a search, it simply > brakes down because its going to compare text input with dates (I > guess). > Any clue how to set scaffold to do the search on date fields? > Or how do I turn the timestamp field from the DB in text before > comparing it with the user input?(I don't believe this to be possible, > but doesn't hurt to ask) I don't think you can search dates as text. Default search is a text search, you can use field_search for more complex searches. > > One other thing. > When I submit, all the form fields I've created are being sent on > POST. > How do I make the scaffold use them? IIRC in field_search you should name the fields as search[column_name]. > > I though on redefine the "update_table" method on the controller, but > I soon realized that it was going to be an headache doing so without > missing anything. > Since I don't even know what to render or where the original code is > so I could "clone" it on that particular spot. > > The form behavior to select the dates and the comparison method > between them its done, but now, under the hood, I not been able to use > the several inputs, either for validation or whatever. > And it brakes even if I only try to include the date field on the > searching fields list. It should work with field_search without custom code. > > On Sep 30, 4:59 pm, "Sergio Cambra .:: entreCables S.L. ::." > > <[email protected]> wrote: > > On Miércoles, 30 de Septiembre de 2009 16:18:45 Esfera escribió: > > > I changed the usual search form from active scaffold to add it a > > > select box, where I choose the kind of date comparison as " < > <= => > > > = != between" and two calendardateselecter. > > > All the elements have different id's. > > > > Have you tried field_search? It has that feature, if I understand you > > right. > > > > > Now comes the big question. > > > > > > How do you do something like sql...yadayada where SOMECOLUMN between > > > X and Y in active scaffold? > > > > > > I've been reading about the search_ui, the search_sql and didn't found > > > a solution or the code for a working example so I could see how. > > > > > > Anyone has an idea on how to do this? > > > > You can add a method to controller to set the conditions for a column, > > but it's used only with field_search. It's explained in Search > > Overrides:http://wiki.github.com/activescaffold/active_scaffold/search-ov > >errides > > > > -- > > Sergio Cambra .:: entreCables S.L. ::. > > Mariana Pineda 23, 50.018 Zaragoza > > T) 902 021 404 F) 976 52 98 07 E) [email protected] > > -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
