Francois Beausoleil
2006-Mar-30 20:36 UTC
Should render(:partial, :collection => nil) do anything special ?
Hi ! Quick question: what should ActionView::Base do when render(:partial => '', :collection => nil) is called ? 1. Don't render anything 2. Render once (current behavior, breaks some views) 3. Raise something I'm inclined to think #1 is the best. What do you people think ? Bye ! -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Kevin Clark
2006-Mar-30 22:36 UTC
Re: Should render(:partial, :collection => nil) do anything special ?
I think it should raise. If you''re calling render partial collection with nil, there''s a problem.. an empty collection ([]) should not render anything, but nil should raise. Kev On 3/30/06, Francois Beausoleil <francois.beausoleil@gmail.com> wrote:> Hi ! > > Quick question: what should ActionView::Base do when render(:partial > => '''', :collection => nil) is called ? > > 1. Don''t render anything > 2. Render once (current behavior, breaks some views) > 3. Raise something > > I''m inclined to think #1 is the best. What do you people think ? > > Bye ! > -- > François Beausoleil > http://blog.teksol.info/ > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > >
Obie Fernandez
2006-Mar-31 00:10 UTC
Re: Should render(:partial, :collection => nil) do anything special ?
This very issue wasted a few minutes of my time yesterday. I agree it should raise an exception. On 3/30/06, Kevin Clark <kevin.clark@gmail.com> wrote:> I think it should raise. If you''re calling render partial collection > with nil, there''s a problem.. an empty collection ([]) should not > render anything, but nil should raise. > Kev > > On 3/30/06, Francois Beausoleil <francois.beausoleil@gmail.com> wrote: > > Hi ! > > > > Quick question: what should ActionView::Base do when render(:partial > > => '''', :collection => nil) is called ? > > > > 1. Don''t render anything > > 2. Render once (current behavior, breaks some views) > > 3. Raise something > > > > I''m inclined to think #1 is the best. What do you people think ? > > > > Bye ! > > -- > > François Beausoleil > > http://blog.teksol.info/ > > > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >