Hello guys, I have a file named "_bar.html.erb" and located at "app/views/foo/" In "app/views/some_path/sample.atom.builder", neither form of the followings worked as expected: render :partial => ''foo/bar'' => MissingTemplate was raised, strange! render :template => ''foo/_bar'' => nil Is it because Builder and ERB are two different systems so that they can''t be mixed together? or because some bug result in the view paths are not properly loaded in builder template Could anyone help me out? My environment: Rails: 2.3.2 Ruby: 1.8.6 Thanks in advance, Ray -- 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=.
Try this (leading slash): render :partial => ''/foo/bar'' Darian Shimy -- http://www.darianshimy.com http://twitter.com/dshimy On Thu, Nov 19, 2009 at 4:20 AM, Ray <xichenster-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello guys, > > I have a file named "_bar.html.erb" and located at "app/views/foo/" > In "app/views/some_path/sample.atom.builder", neither form of the > followings worked as expected: > render :partial => ''foo/bar'' => MissingTemplate was raised, > strange! > render :template => ''foo/_bar'' => nil > > Is it because Builder and ERB are two different systems so that they > can''t be mixed together? or because some bug result in the view paths > are not properly loaded in builder template > > Could anyone help me out? > My environment: > Rails: 2.3.2 > Ruby: 1.8.6 > > Thanks in advance, > Ray > > -- > > 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=. > > >-- 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=.
Hi Darian, It turned out that in "app/views/some_path/sample.atom.builder", render :partial => ''foo/bar'' will looking for a template named "foo/ _bar.atom.erb"( with file extension ".atom"), since such template do not exists, the MissingTemplate exception was raised. So the solution should be: create a file under the name "foo/_bar.atom.erb" OR call render :partial => "foo/bar.html" (specify file extension explicitly) Also, thank you for the suggestion Ray On Nov 20, 12:31 am, Darian Shimy <dsh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try this (leading slash): render :partial => ''/foo/bar'' > > Darian Shimy > --http://www.darianshimy.comhttp://twitter.com/dshimy > > On Thu, Nov 19, 2009 at 4:20 AM, Ray <xichens...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello guys, > > > I have a file named "_bar.html.erb" and located at "app/views/foo/" > > In "app/views/some_path/sample.atom.builder", neither form of the > > followings worked as expected: > > render :partial => ''foo/bar'' => MissingTemplate was raised, > > strange! > > render :template => ''foo/_bar'' => nil > > > Is it because Builder and ERB are two different systems so that they > > can''t be mixed together? or because some bug result in the view paths > > are not properly loaded in builder template > > > Could anyone help me out? > > My environment: > > Rails: 2.3.2 > > Ruby: 1.8.6 > > > Thanks in advance, > > Ray > > > -- > > > 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 athttp://groups.google.com/group/rubyonrails-talk?hl=.-- 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=.
Ray, Good find, I didn''t know that. Darian Shimy -- http://www.darianshimy.com http://twitter.com/dshimy On Thu, Nov 19, 2009 at 7:48 PM, Ray <xichenster-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Darian, > > It turned out that in "app/views/some_path/sample.atom.builder", > render :partial => ''foo/bar'' will looking for a template named "foo/ > _bar.atom.erb"( with file extension ".atom"), since such template do > not exists, the MissingTemplate exception was raised. > > So the solution should be: > create a file under the name "foo/_bar.atom.erb" > OR > call render :partial => "foo/bar.html" (specify file extension > explicitly) > > Also, thank you for the suggestion > > Ray > > On Nov 20, 12:31 am, Darian Shimy <dsh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Try this (leading slash): render :partial => ''/foo/bar'' >> >> Darian Shimy >> --http://www.darianshimy.comhttp://twitter.com/dshimy >> >> On Thu, Nov 19, 2009 at 4:20 AM, Ray <xichens...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Hello guys, >> >> > I have a file named "_bar.html.erb" and located at "app/views/foo/" >> > In "app/views/some_path/sample.atom.builder", neither form of the >> > followings worked as expected: >> > render :partial => ''foo/bar'' => MissingTemplate was raised, >> > strange! >> > render :template => ''foo/_bar'' => nil >> >> > Is it because Builder and ERB are two different systems so that they >> > can''t be mixed together? or because some bug result in the view paths >> > are not properly loaded in builder template >> >> > Could anyone help me out? >> > My environment: >> > Rails: 2.3.2 >> > Ruby: 1.8.6 >> >> > Thanks in advance, >> > Ray >> >> > -- >> >> > 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-/JYPxA39Uh5TLH3MbocFFw@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 athttp://groups.google.com/group/rubyonrails-talk?hl=. > > -- > > 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=. > > >-- 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=.