On 13 March 2012 13:52, Christopher Jones <li...@ruby-forum.com> wrote:
> Hey Colin,
>
> By using my log and typing in each of the fields the same search I get
> the same results back in the log which is as followed:
>
> Started GET "/games?utf8=%E2%9C%93&search=good&commit=Search" for
> 127.0.0.1 at 2012-03-13 13:48:14 +0000
>  Processing by GamesController#index as HTML
>  Parameters: {"utf8"=>"✓", "search"=>"good", "commit"=>"Search"}
>  [1m[36mGame Load (1.0ms)[0m  [1mSELECT `games`.* FROM `games` WHERE ((
> game_name LIKE '%good%' ))[0m
>  [1m[35mGame Load (25.0ms)[0m  SELECT `games`.* FROM `games` WHERE ((
> genre LIKE '%good%' ))
>  [1m[36mGame Load (1.0ms)[0m  [1mSELECT `games`.* FROM `games` WHERE ((
> console LIKE '%good%' ))[0m
>  [1m[35mUser Load (1.0ms)[0m  SELECT `users`.* FROM `users` WHERE
> `users`.`id` = ? LIMIT 1  [["id", 35]]
> Rendered games/index.html.erb within layouts/application (138.0ms)
> Completed 200 OK in 352ms (Views: 286.0ms | ActiveRecord: 58.0ms)

So does the above look correct?
Is it going to the correct action?
Are the parameters correct?
Is the correct query being run?
(I don't know the answer to those, I am just trying to help you work it out).

Colin

>
> It searches all fields apart regardless. Does it by any chance have
> something to do with my controller?
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>



-- 
gplus.to/clanlaw

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to