[Rails] Re: rendering partial problem.
Valery Kvon wrote in post #1048293:
>> 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
end
Hope this helps.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home