app/views/model_info/associations/new.html.erb in model_info-0.0.6 vs app/views/model_info/associations/new.html.erb in model_info-0.0.7
- old
+ new
@@ -1,23 +1,15 @@
-<h3>Add New Record in <%= params[:associated_model_class] %> </h3>
-<div class="jumbotron">
- <%= 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| %>
- <div class="form-group">
- <%= 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]%>
- <div class="form-group">
- <%= f.text_field associated_model_column, :class => 'form-control'%>
- </div>
- </div>
- <% end %>
- <%= f.submit 'Save Changes', class:"btn btn-primary" %>
- <% end %>
-</div>
+<h3>Add New Record in <%= @model_class %> </h3>
+<%= render partial: 'model_info/shared/form',
+ locals:
+ {
+ model_class: @associated_model_class,
+ model_data: @associated_model_data,
+ url: association_create_path,
+ new: true
+ }
+%>