0
Assuming I own the user Admin, the Admin has a login_user
, as system_user
, and this relationship is polymorphic, because other types of users also have login_user
.
When creating the Admin, I must add the fields of login_user
.
<%= form_for(@admin) do |f| %>
<%= f.fields_for :login_user do |login_user_fields|%>
<%= render partial: 'login_users/fields', locals:{f: login_user_fields, login_user: @admin.login_user, }%>
<% end %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
The idea is that when created a new admin, also be created a login_user
to the same, some idea of how to do it?