title: Ruby on Rails: how to make a form for associated models (nested)
body: <p>First of all I have this:</p>
  
  <p><a href="https://polar-scrubland-30279.herokuapp.com/" rel="nofollow noreferrer">https://polar-scrubland-30279.herokuapp.com/</a> - my project which is deployed on heroku (Captain Obvious)</p>
  
  <p>I've got projects and todos inside them.
  For this moment I show all projects using this way:</p>
  
  <pre><code>------index.html.erb------
  
  &lt;%= render @projects %&gt;
  
  ------_project.html.erb-----
  
  &lt;div class="project"&gt;
    &lt;div class="project-header"&gt;
      &lt;h2&gt;&lt;%= project.title %&gt;&lt;/h2&gt;
    &lt;/div&gt;
    &lt;div class="project-todos"&gt;
      &lt;% project.todos.all.each do |todo| %&gt;
        &lt;p&gt;&lt;%= check_box('tag', todo.__id__, {class: 'icheckbox_square-blue', checked: todo.isCompleted}) %&gt; &lt;%= content_tag :todotext, todo.text %&gt;&lt;/p&gt;
      &lt;% end %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And as you understand it doesn't allow me to change my todo's status when checkbox is checked. So that's why I need a form that will allow me to track all the checkboxes. Also I wanna make <code>text-decoration: line-through</code> when checkbox is pressed, but don't get how to. </p>
  
  <p>Is there a way to creat a form which will satisfy my needs? Please can you help me, Any information will be appreciated.</p>
  
  <p><strong>ADDITIONAL INFORAMTION:</strong></p>
  
  <p>GitHub - <a href="https://github.com/NanoBreaker/taskmanager" rel="nofollow noreferrer">https://github.com/NanoBreaker/taskmanager</a></p>
  
  <p>project.rb</p>
  
  <pre><code>class Project &lt; ActiveRecord::Base
    has_many :todos
  end
  </code></pre>
  
  <p>todo.rb</p>
  
  <pre><code>class Todo &lt; ActiveRecord::Base
    belongs_to :project
  end
  </code></pre>