Hi,
I have just installed sphinx and thinking sphinx to allow text
searching.
I just want to know what to write in the model, in addition to my list
of items.
this is my model:
class Ticket < ActiveRecord::Base
belongs_to :status
define_index do
indexes [name, firstname], :as => :name, :sortable => true
#indexes status.name, :as => :status, :sortable => true
end
end
this is my controller ( method index):
def index
@tickets = Ticket.search params[:search]
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @tickets }
end
end
I don't know what i have to write in my view to display and link a
search input text?
Nevertheless, the search works in development console!
Thank you
on 2010-01-25 16:06
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.