Wrap location into searchlink

Hi,

I have a user-view-page…where <%= h @spec.location %> shows the
location of the user. Is is possibly to place a link_to to this
location and then use ferret to search.

so if the location is amsterdam the link must be
http://domain/browse/search?q=amsterdam

controller:

def search
@title = “Zoek IdealeAdviseur”
if params[:q]
query = params[:q]
begin
# First find the user hits…
@users = User.find_by_contents(query, :limit => :all)
# …then the subhits.
specs = Spec.find_by_contents(query, :limit => :all)
faqs = Faq.find_by_contents(query, :limit => :all)
# Now combine into one list of distinct users sorted by last
name.
hits = specs + faqs
@users.concat(hits.collect { |hit| hit.user }).uniq!
# Sort by last name (requires a spec for each user).
@users.each { |user| user.spec ||= Spec.new }
@users = @users.sort_by { |user| user.spec.last_name }

    @pages, @users = paginate(@users)
  rescue Ferret::QueryParser::QueryParseException
    @invalid = true
  end
end

end

Grtz…remco