title: Create action is not working (for model with has many)
body: <p>I am build a Rails app which does the following: a user can create a new project and, inside each Project, it can create different Papers.</p>
  
  <p>I am starting building it from the outer layer (meaning, I first want to be able to create, update, delete a Project before starting to code the Papers part).</p>
  
  <p>I have the following problem: I coded the new and create action for the <code>project_controllers</code> but the new entity is not saved. (It is not displayed in <code>index.html.erb</code> and the <code>_form.html.erb</code> keeps rendering, which means it is not saving)</p>
  
  <p>I think the issue is that a Project <code>has_many</code> Papers and since I have not coded yet the Paper part, it creates issues. BUT I am not sure if this is the right answer.   </p>
  
  <p><strong>project.rb</strong></p>
  
  <pre><code>class Project &lt; ApplicationRecord
      has_many :papers, dependent: :destroy
      belongs_to :user
  end
  </code></pre>
  
  <p><strong>project_controller.rb</strong></p>
  
  <pre><code>class ProjectsController &lt; ApplicationController
    before_action :set_project, only: [:show, :edit, :update, :destroy]
  
    def index
      @projects = Project.all
    end
  
    def show
    end
  
    def new
      @project = Project.new
    end
  
    def create
      @project = Project.new(project_params)
      @project.save
      if @project.save
        redirect_to projects_path()
      else
        render :new
      end
    end
  
    def edit
    end
  
    def update
      @project.update(project_params)
      redirect_to project_path(@project)
    end
  
    def destroy
      @project.destroy
      redirect_to projects_path
    end
  
    private
  
    def project_params
      params.require(:project).permit(:title, :body)
    end
  
    def set_project
      @project = Project.find(params[:id])
    end
  end
  </code></pre>
  
  <p><strong>new.html.erb</strong></p>
  
  <pre><code>&lt;%= render 'form', project: @project %&gt;
  </code></pre>
  
  <p><strong>_form.html.erb</strong></p>
  
  <pre><code>&lt;div class="container"&gt;
    &lt;div class="row "&gt;
      &lt;div class="col-sm-4 col-sm-offset-4"&gt;
        &lt;%= form_for(@project) do |f| %&gt;
        &lt;div class="form-group"&gt;
          &lt;%= f.label :title, "Title of the Project"%&gt;
          &lt;%= f.text_field :title, as: :string, class: 'form-control'%&gt;
        &lt;/div&gt;
  
        &lt;div class="form-group"&gt;
          &lt;%= f.label :body, "Description of the Project"%&gt;
          &lt;%= f.text_area :body, rows: 20, class: 'form-control' %&gt;
        &lt;/div&gt;
  
  
        &lt;%= f.submit "Confirm",  class:"btn btn-secondary btn-lg" %&gt;
        &lt;% end %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>