Partial Search

R

Ruby Geo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Partial Search 1
method use ? 1
Printing result of class method 1
Metho Error 2
Refactor into a class method. 1
Search Array 0
Checking results 0
New Beta FeedBurner Dashboard | Main | Daily Search Forum Recap: 6

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top