Are there any cases in which Rails overwrites controller instance variables on render :partial? -


Is there any case in which any tracks overwrite the controller example variable on a render: partial call a template Is done in? For example, suppose we are:

controller

  def my_action @widget = Widget.find (params [: id]) end  

my_action.html. See ARB

  Hi there & lt;% = render: partial = & gt; 'My_helper'% & gt; Enough is enough.  

See _my _helper.html.erb

  is id & lt;% = @ widget.id.to_s% & Gt;  

Is there a document scenario (by bug or design) in which @Vijet will not be zero when used in my_helper? I see this behavior in an application and I am not able to track my source.

Some notes:
* The app is running in Rail 2.1.1.
* Though local people can be assigned to render: partial => my_helper calls, local reasons are not really ideal in this case for many reasons.
* I spent a good part of time through the action controller and the action view, but are not able to separate the behavior.

No, the frequency variable in the rail will not be overwritten partial

about it Think in: The view has access to all the frequency variables of a controller and is part of a partial view.

However, in cases of use where a shared partial usage is done in the respective views related to different controllers. In that case, the code gets confused within partial because you do not want to name the example variable within the different controller methods. In such cases, the use of hash of local people is a better and cleaner option.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -