Hi, Please try config.columns[:login].search_ui = :integer
-- Volker On 6 Okt., 11:11, johnnybutler7 <[email protected]> wrote: > Ive read api for customising the search and cant seem to find the best > way to configure the search sql for exact matches. > > I have a login field(string) but in certain instances its totally > numeric. I have a controller to allow user to search these numeric > users but i keep getting like.results returned. So searching for 31 > for example will bring back 311, and 3112 before 31. My code is below > with various options ive tried but still get numerous results. > > config.search.columns = [:login] > config.columns[:login].search_sql = 'login' > config.columns[:login].search_ui = :numeric > config.search.full_text_search = false > > What i want is > SELECT "users".* FROM "users" WHERE (LOWER(login) = E'29') > > or to convert it direct to a numeric value and search > > instead im getting > > SELECT "users".* FROM "users" WHERE (LOWER(login) LIKE E'%29%') > > Whats the best way to do this? > > JB --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
