Thursday, May 9, 2013

Re: [Rails] Tokeninput incremental search not working

Hi Colin,

Cold you help me?
I got the same error, because params[:q] is empty.
How did you solve?

Thanks,
Ricardo.

Em sexta-feira, 30 de novembro de 2012 07h15min12s UTC-2, Colin Law escreveu:
On 30 November 2012 04:57, Soichi Ishida <li...@ruby-forum.com> wrote:
> Rails 3.1.3
>
> After watching
>  http://railscasts.com/episodes/258-token-fields?autoplay=true
> I have installed the similar functionality to my app.
>
> However,
>
>     def index
>         @cities = City.all
>         ...
>
> does in fact give the list of all cities in the text field, but
>
>      def index
>         @cities = City.where("name like ?", "%#{params[:q]}%")
>         ...
>
> does NOT search cities at all.

If you look in log/development.log it will show you the database query
being run.  If you still can't see the problem then post the section
of the log for that action (including the query).

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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/tkML9uphpNgJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate