Friday, March 15, 2013

Re: [Rails] Re: Implementing Twitter's new Typeahead in Rails

On 15 March 2013 14:31, Anthony DeFreitas <anthony@caribbeanhotels.com> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate