Search in database


Im am really new to RoR and web and I need some basic help:

I would like to have a text_field and a button in a view, from where I
can type in a string, passing that string to the server side that
iterates through my database to see if the string is within the
database. The server side should then return if the string was found
or not.

What I have problem with in this example is especially how the routing
works between the client/server when just having a string variable
that should be sent to the server without being a model. The code on
the server side is kind of clear.

Thanks in advance

Here is a snip of my view code

<% form_for(:post, :url => search_path, :html => { :method

=> :get }) do |f| -%>
<%= text_field_tag :q, params[:q], “Enter search term(s)”, :style
=> ‘color: #999;’ %>
<%= f.submit(“Search”)%>
<% end -%>

And here is the controller:

def search
@users = params[:q]
end is using Sphinx to search the database…