Add New Record in <%= params[:associated_model_class] %>

<%= form_for @associated_data, url: association_create_path, method: :post do |f| %> <% (@associated_data.class.column_names - %w(id created_at updated_at serialized_options)).each do |associated_model_column| %>
<%= f.label associated_model_column %> <%= hidden_field_tag :associated_model_class, params[:associated_model_class]%> <%= hidden_field_tag :associated_model, params[:associated_model]%> <%= hidden_field_tag :model_class, params[:model_class]%> <%= hidden_field_tag :model_object_id, params[:model_object_id]%>
<%= f.text_field associated_model_column, :class => 'form-control'%>
<% end %> <%= f.submit 'Save Changes', class:"btn btn-primary" %> <% end %>