Forum: Rails France What do i have to write in the view for search input? (Sphinx)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
trankh (Guest)
on 2010-01-25 16:06
(Received via mailing list)
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
This topic is locked and can not be replied to.