Hello,
I'm new to programming and to Ruby on Rails, and I'm trying to implement an address book on rails with active search with ajax. Active search is working fine with English letters, but when I'm trying to search Greek entries I don't get any result.
I wrote a code showing what is searching so I noticed that if I put a Greek letters acts like I haven't put nothing in the search field, also if I put English letters after the Greek letters also happens the same thing.... Here is the observe_field code:
<%= observe_field :search,
:frequency => 0.5,
:update => 'search_results',
:url => { :action=> 'search_results' },
:with => "'search=' + escape(value)"
%>
and the search result function
def search_results
@search = String(params[:search])
@collection = Customer.find(:all, :conditions => ["address LIKE ? OR name LIKE ? OR surname LIKE ? OR mobile_phone LIKE ? OR home_phone LIKE ? OR dei_number LIKE ? OR city LIKE ?",'%'+@search+'%', '%'+@search+'%', '%'+@search+'%', '%'+@search+'%', '%'+@search+'%', '%'+@search+'%', '%'+@search+'%'])
@number_match [email protected]
render :partial => 'search'
end
Hope you can help cause I don't have a clue what I should do...
PS: I'm sorry for my bad English