Hi Colin,
I have made some progression.
I have no changed the code a bit and the consearch works but none of the
others do despite having the same code?
My model is the same but my controller has changed to the following:
@games = Game.gamsearch(params[:gamsearch])
@games = Game.gensearch(params[:gensearch])
@games = Game.consearch(params[:consearch])
and my view the following:
<%= form_tag games_path, :controller => 'games', :action => 'gamsearch',
:method => 'get' do %>
<%= text_field_tag :gamsearch, params[:gamsearch] %>
<%= submit_tag t('.searchb'), :game_name => nil %>
<% end %>
<%= form_tag games_path, :controller => 'games', :action => 'gensearch',
:method => 'get' do %>
<%= text_field_tag :gensearch, params[:gensearch] %>
<%= submit_tag t('.searchb'), :game_name => nil %>
<% end %>
<%= form_tag games_path, :controller => 'games', :action => 'consearch',
:method => 'get' do %>
<%= text_field_tag :consearch, params[:consearch] %>
<%= submit_tag t('.searchb'), :game_name => nil %>
<% end %>
Might it have something to do with console being the last of the list,
maybe taking in only the last set of data.
I have the following in my log for when I click consearch:
Started GET "/games?utf8=%E2%9C%93&consearch=play&commit=Search" for
127.0.0.1 at 2012-03-13 14:24:08 +0000
Processing by GamesController#index as HTML
Parameters: {"utf8"=>"✓", "consearch"=>"play", "commit"=>"Search"}
[1m[36mGame Load (2.0ms)[0m [1mSELECT `games`.* FROM `games` [0m
[1m[35mCACHE (0.0ms)[0m SELECT `games`.* FROM `games`
[1m[36mGame Load (1.0ms)[0m [1mSELECT `games`.* FROM `games` WHERE ((
console LIKE '%play%' ))[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 (242.0ms)
Completed 200 OK in 484ms (Views: 439.0ms | ActiveRecord: 39.0ms)
and the following when I click gensearch:
Started GET "/games?utf8=%E2%9C%93&gensearch=tit&commit=Search" for
127.0.0.1 at 2012-03-13 14:24:21 +0000
Processing by GamesController#index as HTML
Parameters: {"utf8"=>"✓", "gensearch"=>"tit", "commit"=>"Search"}
[1m[36mGame Load (1.0ms)[0m [1mSELECT `games`.* FROM `games` [0m
[1m[35mGame Load (2.0ms)[0m SELECT `games`.* FROM `games` WHERE ((
genre LIKE '%tit%' ))
[1m[36mCACHE (0.0ms)[0m [1mSELECT `games`.* FROM `games` [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 (252.0ms)
Completed 200 OK in 399ms (Views: 360.0ms | ActiveRecord: 34.0ms)
What I have noticed is that the CACHE and Game are swapped around in the
gensearch but I have no idea why.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.