#126 new
Gwendydd

undefined method `new_search'

Reported by Gwendydd | June 3rd, 2010 @ 05:43 PM

Hello! I know that I'm not the first person to have this problem, but I haven't been able to find a solution to it that works for me.

I have an app in Rails v. 2.2.3-2, and I just installed Searchlogic v. 2.4.19.

I have a model called sources, and this is in its controller:
--------------------Sources_controller.rb-------------------------- class SourcesController < ApplicationController
before_filter :login_required, :only => [ :new, :create, :edit, :update, :delete, :show_cat ]

def index

 @search = Source.new_search(params[:search])
 @sources, @sources_count = @search.all, @search.count

end

[etc]

When I run the app, I get the following error (full trace):

NoMethodError in SourcesController#index

undefined method new_search' for #<Class:0xb6de0330>

RAILS_ROOT: /home/morgan/omsb
Application Trace | Framework Trace | Full Trace

vendor/plugins/searchlogic/lib/searchlogic/named_scopes/conditions.rb:81:in method_missing'<br/> vendor/plugins/searchlogic/lib/searchlogic/named_scopes/association_conditions.rb:19:inmethod_missing'
vendor/plugins/searchlogic/lib/searchlogic/named_scopes/association_ordering.rb:27:in method_missing'<br/> vendor/plugins/searchlogic/lib/searchlogic/named_scopes/ordering.rb:30:inmethod_missing'
vendor/plugins/searchlogic/lib/searchlogic/named_scopes/or_conditions.rb:28:in method_missing'<br/> vendor/rails/activerecord/lib/active_record/base.rb:1835:inmethod_missing'
app/controllers/sources_controller.rb:5:in index'

vendor/plugins/searchlogic/lib/searchlogic/named_scopes/conditions.rb:81:in method_missing'<br/> vendor/plugins/searchlogic/lib/searchlogic/named_scopes/association_conditions.rb:19:inmethod_missing'
vendor/plugins/searchlogic/lib/searchlogic/named_scopes/association_ordering.rb:27:in method_missing'<br/> vendor/plugins/searchlogic/lib/searchlogic/named_scopes/ordering.rb:30:inmethod_missing'
vendor/plugins/searchlogic/lib/searchlogic/named_scopes/or_conditions.rb:28:in method_missing'<br/> vendor/rails/activerecord/lib/active_record/base.rb:1835:inmethod_missing'
vendor/rails/actionpack/lib/action_controller/base.rb:1256:in send'<br/> vendor/rails/actionpack/lib/action_controller/base.rb:1256:inperform_action_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:617:in call_filters'<br/> vendor/rails/actionpack/lib/action_controller/filters.rb:610:inperform_action_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in perform_action_without_rescue'<br/> /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in perform_action_without_rescue'<br/> vendor/rails/actionpack/lib/action_controller/rescue.rb:136:inperform_action_without_caching'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in perform_action'<br/> vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:incache'
vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in cache'<br/> vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:inperform_action'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in send'<br/> vendor/rails/actionpack/lib/action_controller/base.rb:524:inprocess_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:606:in process_without_session_management_support'<br/> vendor/rails/actionpack/lib/action_controller/session_management.rb:134:inprocess'
vendor/rails/actionpack/lib/action_controller/base.rb:392:in process'<br/> vendor/rails/actionpack/lib/action_controller/dispatcher.rb:184:inhandle_request'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:112:in dispatch_unlocked'<br/> vendor/rails/actionpack/lib/action_controller/dispatcher.rb:125:indispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:in synchronize'<br/> vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:indispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:134:in dispatch_cgi'<br/> vendor/rails/actionpack/lib/action_controller/dispatcher.rb:41:indispatch'
vendor/rails/railties/lib/webrick_server.rb:103:in handle_dispatch'<br/> vendor/rails/railties/lib/webrick_server.rb:74:inservice'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:inrun' /usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:instart' /usr/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:instart' /usr/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/lib/ruby/1.8/webrick/server.rb:92:instart' /usr/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart' vendor/rails/railties/lib/webrick_server.rb:60:in dispatch'<br/> vendor/rails/railties/lib/commands/servers/webrick.rb:66<br/> /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' vendor/rails/activesupport/lib/active_support/dependencies.rb:153:inrequire'
vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in'<br/> vendor/rails/activesupport/lib/active_support/dependencies.rb:153:inrequire'
vendor/rails/railties/lib/commands/server.rb:49
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire' script/server:3

vendor/plugins/searchlogic/lib/searchlogic/named_scopes/conditions.rb:81:in method_missing'<br/> vendor/plugins/searchlogic/lib/searchlogic/named_scopes/association_conditions.rb:19:inmethod_missing'
vendor/plugins/searchlogic/lib/searchlogic/named_scopes/association_ordering.rb:27:in method_missing'<br/> vendor/plugins/searchlogic/lib/searchlogic/named_scopes/ordering.rb:30:inmethod_missing'
vendor/plugins/searchlogic/lib/searchlogic/named_scopes/or_conditions.rb:28:in method_missing'<br/> vendor/rails/activerecord/lib/active_record/base.rb:1835:inmethod_missing'
app/controllers/sources_controller.rb:5:in index'<br/> vendor/rails/actionpack/lib/action_controller/base.rb:1256:insend'
vendor/rails/actionpack/lib/action_controller/base.rb:1256:in perform_action_without_filters'<br/> vendor/rails/actionpack/lib/action_controller/filters.rb:617:incall_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:610:in perform_action_without_benchmark'<br/> vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue'
vendor/rails/actionpack/lib/action_controller/rescue.rb:136:in perform_action_without_caching'<br/> vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:inperform_action'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in cache'<br/> vendor/rails/activerecord/lib/active_record/query_cache.rb:8:incache'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in perform_action'<br/> vendor/rails/actionpack/lib/action_controller/base.rb:524:insend'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in process_without_filters'<br/> vendor/rails/actionpack/lib/action_controller/filters.rb:606:inprocess_without_session_management_support'
vendor/rails/actionpack/lib/action_controller/session_management.rb:134:in process'<br/> vendor/rails/actionpack/lib/action_controller/base.rb:392:inprocess'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:184:in handle_request'<br/> vendor/rails/actionpack/lib/action_controller/dispatcher.rb:112:indispatch_unlocked'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:125:in dispatch'<br/> vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:insynchronize'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:in dispatch'<br/> vendor/rails/actionpack/lib/action_controller/dispatcher.rb:134:indispatch_cgi'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:41:in dispatch'<br/> vendor/rails/railties/lib/webrick_server.rb:103:inhandle_dispatch'
vendor/rails/railties/lib/webrick_server.rb:74:in service'<br/> /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach' /usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart' /usr/lib/ruby/1.8/webrick/server.rb:82:in start' vendor/rails/railties/lib/webrick_server.rb:60:indispatch'
vendor/rails/railties/lib/commands/servers/webrick.rb:66
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire' vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in require'<br/> vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in'
vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in require'<br/> vendor/rails/railties/lib/commands/server.rb:49<br/> /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' script/server:3


Am I missing something really dumb here?

Thanks for your help!
Morgan.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket

Pages