Rails - Nested Forms will create, but information won't be saved <p>I've been struggling to get my nested form to save the users' inputs. The "outer" form saves the information perfectly. The "inner", or nested, one creates a new object, and passes hidden-field informations, but all other values are "nil".</p> <p>Each order has one or more date_orders, and you should be able to create the first one through this form.</p> <p>My code follows. Please help me spot anything that might be causing that. I've browsed StackOverflow extensively.</p> <p>orders_controller.rb</p> <pre><code>class OrdersController &lt; ApplicationController def new @order = Order.new @order.date_orders.build end def create @order = Order.new(order_params) @order.date_orders.build if @order.save flash[:success] = "Success" redirect_to current_user else render 'new' end end def order_params params.require(:order).permit( :user_id, :description, date_order_attributes: [:id, :order_date, :time_start, :time_end, :order_id]) end end </code></pre> <p>order.rb</p> <pre><code>class Order &lt; ActiveRecord::Base has_many :date_orders, :dependent =&gt; :destroy accepts_nested_attributes_for :date_orders end </code></pre> <p>date_order.rb</p> <pre><code>class DateOrder &lt; ActiveRecord::Base belongs_to :order end </code></pre> <p>routes.rb --> date_orders is not mentioned in the routes. Is that a problem?</p> <p>orders/new.html.erb</p> <pre><code>&lt;%= form_for(@order, :html =&gt; {:multipart =&gt; true}) do |f| %&gt; &lt;!-- form_for fields FIELDS --&gt; &lt;%= fields_for :date_orders do |builder| %&gt; &lt;%= builder.hidden_field :order_id, :value =&gt; @order.id %&gt; &lt;- THIS WORKS &lt;%= builder.label :date %&gt; &lt;%= builder.date_field :order_date %&gt; &lt;%= builder.label :starting_time %&gt; &lt;%= builder.time_field :time_start %&gt; &lt;%= builder.label :ending_time %&gt; &lt;%= builder.time_field :time_end %&gt; &lt;% end %&gt; &lt;%= f.submit "Request", class: "btn" %&gt; &lt;% end %&gt; </code></pre> <p>EDIT: example of a hash that is created:</p> <pre><code>&lt;DateOrder id: 9, order_date: nil, time_start: nil, time_end: nil, order_id: 29, created_at: "2016-04-29 22:43:18", updated_at: "2016-04-29 22:43:18"&gt;enter code here` </code></pre>