Ruby on Rails Friday, November 30, 2012

On 30 November 2012 04:57, Soichi Ishida <lists@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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment