Displaying 1 result from an estimated 1 matches for "a12df23466bc1422039931239cdbd144".
2006 Jul 21
1
Passing a variable between methods
Hi,
I am trying to add search functionality to may application. I am
struggeling to pass my query to the controller and then show all my
search results in another view. How would I do this?
Model:
class Advert < ActiveRecord::Base
belongs_to :user
def self.search(query)
if !query.to_s.strip.empty?
tokens = query.split.collect {|c| "%#{c.downcase}%"}