rails/rails — Issue #3573: render throws confusing exception when :partial is nil
Author: mscottford
Created: 2011-11-08 21:08:11+00:00
State: open

Invoking `render :partial => nil, :locals => { :junk => Object.new }` results in `undefined method `model_name' for NilClass:Class`. I think it'd be better if the report was that the value for partial can't be nil.

I've created a sample project that simulates the setting that I found this issue in. It took me way too long to figure out that nil was getting passed in as the value for `:partial`. The sample project can be found at https://github.com/mscottford/rails-confusion.