I''m getting an error type mismatch: String given RAILS_ROOT: ./script/../config/.. Application Trace <http://localhost:3000/ajaxsearch/index#> | Framework Trace <http://localhost:3000/ajaxsearch/index#> | Full Trace<http://localhost:3000/ajaxsearch/index#> #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:26:in `=~'' #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:26:in `list'' #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:22:in `list'' cond = EZ::Where::Condition.new do category_id === [category_id] # these are integers coming in state_id === [state_id] # same term_id === [term_id] # same city =~ ''%city'' # this would be a string title =~ ''%title'' # string as well end Something wrong here ? Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I don''t know this plugin at all, but normally you need to give a |thingie| in a block, so my guess would be: cond = EZ::Where::Condition.new do |ez| ez.category_id === [category_id] # these are integers coming in ez.state_id === [state_id] # same ez.term_id === [term_id] # same ez.city =~ ''%city'' # this would be a string ez.title =~ ''%title'' # string as well end i could be totally wrong though :-D --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/16/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m getting an error > > type mismatch: String given > > RAILS_ROOT: ./script/../config/.. > Application Trace <http://localhost:3000/ajaxsearch/index#> | Framework > Trace <http://localhost:3000/ajaxsearch/index#> | Full Trace<http://localhost:3000/ajaxsearch/index#> > > #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:26:in `=~'' > #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:26:in `list'' > #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:22:in `list'' > > cond = EZ::Where::Condition.new do > category_id === [category_id] # these are integers coming in > state_id === [state_id] # same > term_id === [term_id] # same > city =~ ''%city'' # this would be a string > title =~ ''%title'' # string as well > > end > > Something wrong here ? > Stuart=~ is looking for a regexp. instead of providing ''%city'' try using /city$/ Or something similar. Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Oct 16, 9:23 am, "Daniel N" <has....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/16/06, Dark Ambient <sambi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > I''m getting an error > > > type mismatch: String given > > > RAILS_ROOT: ./script/../config/.. > > Application Trace <http://localhost:3000/ajaxsearch/index#> | Framework > > Trace <http://localhost:3000/ajaxsearch/index#> | Full Trace<http://localhost:3000/ajaxsearch/index#> > > > #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:26:in `=~'' > > #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:26:in `list'' > > #{RAILS_ROOT}/app/controllers/ajaxsearch_controller.rb:22:in `list'' > > > cond = EZ::Where::Condition.new do > > category_id === [category_id] # these are integers coming in > > state_id === [state_id] # same > > term_id === [term_id] # same > > city =~ ''%city'' # this would be a string > > title =~ ''%title'' # string as well > > > end > > > Something wrong here ? > > Stuart=~ is looking for a regexp. > > instead of providing ''%city'' try using /city$/ > > Or something similar. > > CheersNo, ''=~'' maps to a LIKE SQL action, so the format specified is correct. He is missing a table name for the block... It should be something like this.. cond = EZ::Where::Condition.new :some_table_name do category_id === [category_id] # these are integers coming in state_id === [state_id] # same term_id === [term_id] # same city =~ ''%city'' # this would be a string title =~ ''%title'' # string as well end _Kevin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---