title: Does rails automatically pass '@variables' into partial?
body: <p>I have a simple setup:</p>
  
  <pre><code>class EventsController &lt; ApplicationController
    def edit
      @user = User.find(params[:user_id])
      @event = Event.find(params[:id])
    end
  end
  </code></pre>
  
  <p><strong>events\edit.html.erb:</strong></p>
  
  <pre><code>&lt;h1&gt;Edit &lt;%= @user.name %&gt;'s event&lt;/h1&gt;
  
  &lt;%= render 'form' %&gt;
  </code></pre>
  
  <p><strong>events\_form.html.erb:</strong></p>
  
  <pre><code>&lt;%= form_for [@user, @event] do |f| %&gt;
  
    &lt;%= f.label :title %&gt;
    &lt;%= f.text_field :title %&gt;
  
    &lt;%= f.label :description %&gt;
    &lt;%= f.text_area :description %&gt;
  
    &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>To my biggest surprise this code is working and I am not getting any errors. Form partial knows about @user and @event! 
  <strong>I always thought I have to pass parameters as locals</strong> in order to access them in the partial, so the render from the view have to be:</p>
  
  <pre><code>&lt;%= render 'form', user: @user, event: @event %&gt;
  </code></pre>
  
  <p>And form_for line should be changed to:</p>
  
  <pre><code>&lt;%= form_for [user, event] do |f| %&gt;
  </code></pre>
  
  <p>Am I missing something here? Is it one of those days when I confused my self so much that I should probably get some sleep?</p>
  
  <p>I am running this on Rails 4.1.4 and events are nested resources of user if that changes anything.    </p>