title: Invalid association. Make sure that accepts_nested_attributes_for is used for :questions association
body: <p>i am building nested form in rails 4.I  keep getting this error </p>
  
  <p>my _form.html.erb as</p>
  
  <pre><code>    &lt;%= nested_form_for (@project) do |f| %&gt;
      &lt;% if @project.errors.any? %&gt;
      &lt;div id="error_explanation"&gt;
      &lt;h2&gt;&lt;%= pluralize(@project.errors.count, "error") %&gt; prohibited this project from being saved:&lt;/h2&gt;
  
      &lt;ul&gt;
      &lt;% @project.errors.full_messages.each do |message| %&gt;
        &lt;li&gt;&lt;%= message %&gt;&lt;/li&gt;
       &lt;% end %&gt;
       &lt;/ul&gt;
       &lt;/div&gt;
      &lt;% end %&gt;
  
      &lt;div class="field"&gt;
      &lt;%= f.label :name %&gt;&lt;br&gt;
      &lt;%= f.text_field :name %&gt;
      &lt;/div&gt;
  
      &lt;%= f.fields_for :questions do |builder| %&gt;
      &lt;%= render "question_fields", :f =&gt; builder %&gt;
      &lt;% end %&gt;
  
      &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
      &lt;/div&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>_question.html.erb</p>
  
  <pre><code>      &lt;p&gt;
              &lt;%= f.label :content, "Question" %&gt;&lt;br /&gt;
              &lt;%= f.text_area :content, :rows =&gt; 3 %&gt;&lt;br /&gt;
              &lt;%= f.label :subject, "Question" %&gt;&lt;br /&gt;
              &lt;%= f.text_field :subject %&gt;&lt;br /&gt;
              &lt;%= f.link_to_remove "Remove this task" %&gt;
              &lt;p&gt;&lt;%= f.link_to_add "Add a questions",:questions %&gt;&lt;/p&gt;
       &lt;/p&gt;
  </code></pre>
  
  <p>project.rb</p>
  
  <pre><code>       has_many :questions, :dependent =&gt; :destroy
  
         accepts_nested_attributes_for :questions, :reject_if =&gt; lambda { |a| a[:content].blank? }, :allow_destroy =&gt; true
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>question.rb</p>
  
  <pre><code>      class Question &lt; ActiveRecord::Base
  
         belongs_to :project
  
         end
  </code></pre>
  
  <p>projects controller</p>
  
  <pre><code>      def new
        @project = Project.new
         3.times do
         question = @project.questions.build
          end
        def project_params
        params.require(:project).permit(:name)
        end
  
          def create
          @project = Project.new(project_params)
  
          respond_to do |format|
          if @project.save
          format.html { redirect_to @project, notice: 'Project was successfully created.' }
           format.json { render :show, status: :created, location: @project }
          else
           format.html { render :new }
          format.json { render json: @project.errors, status: :unprocessable_entity }
         end
        end
  </code></pre>
  
  <p>end</p>
  
  <p>I used "<strong>nested_form</strong>" gem Gives Error <code>Invalid association. Make sure that accepts_nested_attributes_for is used for :questions association.</code></p>
  
  <p>pls help me to get rid of this error</p>
  
  <p>questions controller def:-</p>
  
  <pre><code>      def question_params
        params.require(:question).permit(:project_id, :subject, :content)
        end
  </code></pre>