Hello,
In a list view, I’m trying to list a subset of a table’s records based
on a partial search value. So if the user enters " Smith " then the view
should list all records with " Smith " as the value of the relevant
field. I have this partial listing of the Find view:
Enter name to find
<%= start_form_tag :action => 'find' %>
<p>
<%= text_field_tag :name, params[:name] %>
</p>
<%= link_to "Find It", :class => "submit" %>
<%= end_form_tag %>
Then, in the controller, I have this action:
def find
…
user = User.find_by_name(:all, :conditions => “name like
‘%#{params[:name]}%’”)
…
end
The result: no records found, despite some records satisfying the query.
Where did I go wrong?
Thanks for the help,
gk