Are there any cases in which Rails overwrites controller instance variables on a render :partial call performed in a template? For example, let's say we have:
controller
def my_action
@widget = Widget.find(params[:id])
end
view my_action.html.erb
Hi there.
<%= render :partial => 'my_helper' %>
That's it, that's all.
view _my
_helper.html.erb
The id is <%= @widget.id.to_s %>.
Are there any documented scenarios (bugs or by design) in which @widget would be nil when used in my_helper? I'm seeing this behavior in an application and haven't been able to track down its source.
A few notes:
* The app is running in Rails 2.1.1.
* While it would be possible to assign locals to the render :partial => my_helper call, for a number of reasons locals aren't really ideal in this case.
* I spent a good chunk of time sifting through ActionController and ActionView, but haven't been able to isolate the behavior.