I have a table symbols
which contains columns: id and symbol_name
, where id
is the primary key of that table
In my Symbol model, I have
class Symbol < ActiveRecord::Base
def symbol_id
"EMI:#{self.id}"
end
end
On my index.html.erb page, users can search for symbols with id 777 by entering "EMI:777" in the search textfield.
I am using searchlogic for searching.
<% form_for @search do |f| %>
Search:
<%= f.text_field :symbol_id_or_symbol_name_like %>
<%= f.submit "Search" %>
<% end %>
When i use 'symbol_id' in the search form , i get the following error message:
The condition 'symbol_id' is not a valid condition, we could not find any scopes that match this.
Any suggestion is most appreciated