title: Rails simple_fields_for
body: <p>I am working on a rails 3.0.11 application. for a many to many association I used <code>simple_fields_for</code> in a form.</p>
  
  <pre><code>simple_form_for @test do |f| 
    f.input :example 
    f.simple_fields_for :services do |builder| 
      render "services_partial", :f =&gt; builder
    end 
  end 
  </code></pre>
  
  <p>Now this is the main form and I used <code>simple_fields_for</code> in the form to render the partial of many to many association model called services
  In the services partial</p>
  
  <pre><code>f.input :example_service 
  f.another_service 
  </code></pre>
  
  <p>What I want to do is to assign the value of <code>example_service</code> attribute to a variable like</p>
  
  <pre><code>var = @test.services.example_service
  </code></pre>
  
  <p>but this method is not correct. Can anyone help me that how I can access this for each service. because there may be multiple services.</p>