Showing C:/finalproject/app/views/searches/show.html.erb where line #3
raised:
Missing partial games/game with {:handlers=>[:erb, :builder, :coffee],
What about Missing partial games/game (/views/games/_game.html.erb) ?
in my games view folder I have the following:
index
new
show
edit
_form
I don't really understand the missing partial part. I have already
uploaded my search_controller and show.html classes. I have below my
search.rb model file if it is of any use:
class Search < ActiveRecord::Base
attr_accessible :game_name, :console, :genre
def games
@games ||= find_games
end
private
def find_games
Game.find(:all, :conditions => conditions)
end
def name_conditions
["game_name LIKE ?", "%#{game_name}%"] unless game_name.blank?
end
def console_conditions
["console LIKE ?", "%#{console}"] unless console.blank?
end
def genre_conditions
["genre LIKE ?", "%#{genre}"] unless genre.blank?
end
def conditions
[conditions_clauses.join(' AND '), *conditions_options]
end
def conditions_clauses
conditions_parts.map { |condition| condition.first }
end
def conditions_options
conditions_parts.map { |condition| condition[1..-1] }.flatten
end
def conditions_parts
private_methods(false).grep(/_conditions$/).map { |m| send(m)
}.compact
end
If you have an instance of a model to render into a partial, you can use
a shorthand syntax:
<%= render @customer %>
Assuming that the @customer instance variable contains an instance of
the Customer model, this will use _customer.html.erb to render it and
will pass the local variable customer into the partial which will refer
to the @customer instance variable in the parent view.
I literally just solved it before you posted this thanks for all the
help, after reading a previous reply to my post it just clicked. Thanks
all.