Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Partial Search
Ruby Geo
12/17/2007 9:40:00 AM
Can someone please help me to adjust the folowing method into
displaying
using a flag. Basically what I want it to do it have an array of
keywords
and a flag which asks partial match or exact
These are the keywords.
------------------------
KEYWORDS =["Sole Trader", "Retail", "Builder", "Internet" ]
And this is the current method.
-------------------------
def self.search_by_keyword(businesses, searched_keyword)
businesses.select do |b|
b.my_keywords.include?(searched_keyword)
end
end
It has to me something like this.
----------------------------
def self.search_by_keyword(businesses, searched_keyword_as_array,
flag_exact_or_partial_match)
businesses.select do |b|
b.my_keywords.include?(searched_keyword)
end
en
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Partial Search
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password