Can anyone help me? I have a problem that when I click on the search button I get the following error message: ActionView::MissingTemplate in Searches#show Showing C:/finalproject/app/views/searches/show.html.erb where line #3 raised: Missing partial games/game with {:handlers=>[:erb, :builder, :coffee], :formats=>[:html], :locale=>[:en, :en]}. Searched in: * "C:/finalproject/app/views" * "C:/Ruby/lib/ruby/gems/1.9.1/gems/kaminari-0.13.0/app/views" I have the following in my show.html.erb: <h2>Search</h2> <%= render :partial => @search.games%> Any ideas? Thanks R.Patrick -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Feb 22, 2012 at 2:02 PM, Roger Patrick <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Can anyone help me? > > I have a problem that when I click on the search button I get the > following error message: > > ActionView::MissingTemplate in Searches#show > > Showing C:/finalproject/app/views/searches/show.html.erb where line #3 > raised: > > Missing partial games/game with {:handlers=>[:erb, :builder, :coffee], > :formats=>[:html], :locale=>[:en, :en]}. Searched in: > * "C:/finalproject/app/views" > * "C:/Ruby/lib/ruby/gems/1.9.1/gems/kaminari-0.13.0/app/views" > > > I have the following in my show.html.erb: > > <h2>Search</h2> > > <%= render :partial => @search.games%> > > Any ideas? > > Thanks > R.Patrick > >What do you have in your controller? Searches#show Javier Q -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Javier Quarite wrote in post #1048286:> On Wed, Feb 22, 2012 at 2:02 PM, Roger Patrick <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: > >> Missing partial games/game with {:handlers=>[:erb, :builder, :coffee], >> >> Any ideas? >> >> Thanks >> R.Patrick >> >> > What do you have in your controller? Searches#show > > > Javier Qclass SearchesController < ApplicationController def new @search = Search.new end def create @search = Search.new(params[:search]) if @search.save redirect_to @search, :notice => "Successfully created search." else render :action => ''new'' end end def show @search = Search.find(params[:id]) end end -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Feb 22, 2012 at 2:15 PM, Roger Patrick <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > class SearchesController < ApplicationController > def new > @search = Search.new > end > > def create > @search = Search.new(params[:search]) > if @search.save > redirect_to @search, :notice => "Successfully created search." > else > render :action => ''new'' > end > end > > def show > @search = Search.find(params[:id]) > end > end >If you see the log, the you''ll see a query ( the result of Search.find(params[:id]), after that you haven''t told rails what to do with it, so as you see on you create method you''re being redirect to "@search" (that''s a sort of abreviation of what you have on your routes.rb file) You may want to do a respond_to block, try searching that on rails guide or try this tutorial http://ruby.railstutorial.org/ Javier Q> >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> 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) ? :) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23.02.2012, at 0:16, Roger Patrick wrote:> > 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:<%= render @search.games %> means you have partial file: ---- /app/views/games/_game.erb.html hello world!, i''m <%= game %> instance! ---- http://guides.rubyonrails.org/layouts_and_rendering.html 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. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
> <%= render @search.games %> > > means you have partial file: > > ---- /app/views/games/_game.erb.html > > hello world!, i''m <%= game %> instance! > > ---- > > http://guides.rubyonrails.org/layouts_and_rendering.html > > 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. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.