Sorry for not being so precise. 

Processing by SubCategoriesController#names as JSON
  Parameters: {"q"=>"a"}
  SubCategory Load (0.8ms)  SELECT "sub_categories".* FROM "sub_categories" 
WHERE (name LIKE 'a%')

On Friday, March 15, 2013 10:40:18 AM UTC-4, Colin Law wrote:
>
> On 15 March 2013 14:31, Anthony DeFreitas 
> <[email protected]<javascript:>> 
> wrote: 
>
> Please don't top post, it makes it difficult to follow the thread. 
> Insert your reply at appropriate points in previous message.  Thanks. 
>
> > Ok, getting closer. I found this post which says if I remove the leading 
> '%' 
> > in the query it will find entries that 'Begin' with what is typed. This 
> > didn't work for me though and my query follows the same format: 
> > 
> > SubCategory.where("name like ?", "#{params[:q]}%") 
>
> The % chars are wildcards so as you have it now it should find 
> anything beginning with params[:q].  You say this did not work but 
> have not told us what happened.  We are not telepathic.  Once again, 
> if you post the log and the query we may be able to help.  I presume 
> you have looked at those again. 
>
> Colin 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/C3joX8C3JkEJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to