Could use some help setting up an AJAX Search form for Users...
config.rb - controller:
resources :users, :only => [:index, :show, :searchresult] do
collection do
get 'searchresult'
end
end
Model
def self.search(search)
if search
find(:all, :conditions => ['name LIKE ?', "%#{search}%"])
else
find(:all)
end
end
Controller:
def searchresult
@users = User.search(params[:name])
end
View:
<% form_tag users_searchresult_path, :method => 'get' do %>
Right now I'm getting the following error: undefined local variable or method `users_searchresult_path' for #<#:0x1092ecdb8>
What do you think? Thanks!