Displaying 3 results from an estimated 3 matches for "gamescontrol".
2012 Feb 23
4
Undefined Method
...to display all records that have
Dreamcast stored as their console.
I have the following example code in my index class:
<%= link_to ''DREAMCAST'', games_path(:console => ''Dreamcast'')%>
the above code is repeating for each individual console.
Now in my gamescontroller I have the following in my index:
def index
@games = Game.paginate(:per_page => 4, :page =>
params[:page]).search(params[:search])
@games = @games.find_by_console(params[:console]) unless
params[:console].blank?
end
The problem I receive is that when I click on the Gaming sec...
2008 May 30
6
Session problem
...username(params[:login])
if @user and @user.password_is? params[:password]
session[:user] = @user.id
redirect_to :controller => ''games''
else
@auth_error = ''Wrong username or password''
end
end
end
And here''s the code of my GamesController. User needs to be logged in
to access the games webpage (using check_auth method) and on that
page the user can create a new game (adding a record in the game
table,
with a few fields from the form filled by the user and a field with
the user''s
username, that''s why I need to ge...
2012 Feb 21
10
Search of multiple columns
I am currently writing a search method for my rails applications and at
the moment it works fine. I have the following in my game.rb:
def self.search(search)
if search
find(:all, :conditions => [''game_name LIKE ? OR genre LIKE ? OR
console LIKE ?'', "%#{search}%", "#{search}", "#{search}"])
else
find(:all)
end
end
No that searches