Select model & field for search

hi, I was wondering if someone could help me? I am trying to create a
select option for the ferret search in my app. I want users to be able
to select from a range of fields and models to limit their query
results.

So far i have a select box;

<input type="text" name="query" value="<%= h @query %>" />
<%= select(:searchbox, :category, %w{everything tags name products

})%>

but i have no idea how to set this to limit the search within the
categories.

I know you can limit query by querying name:bob but this is too
difficult for users. Is there a nice way to do code this?

Thanx, Jos

On Fri, May 18, 2007 at 10:12:19AM +0200, Jos wrote:

but i have no idea how to set this to limit the search within the
categories.

I know you can limit query by querying name:bob but this is too
difficult for users. Is there a nice way to do code this?

you could build the query string programmatically, or build query
objects
directly from your user’s input (the Ferret API docs have more info
about the various kinds of query types available)

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs