How to get defaults from database to show for field with nested association?

Hello, I am trying to get the date field stored in the database to show when editing a field through an association, unfortunately it automatically goes back to 2012-01-01 rather than the actual date. Could someone point me in the right direction to show this?

This is the code so far:

<%= inputs_for @f, :entry, fn fp -> %>
  <div class="form-group">
<%= label @f, :publish_time, class: "control-label" %>
<%= datetime_select @f, :publish_time, class: "form-control" %>
<%= error_tag @f, :publish_time %>
  </div>
<% end %>

Thanks.

1 Like

NM, figured it out, just needed to use fp instead of @f for the fields.

2 Likes