app/views/carnival/shared/form/_inner_form.html.haml in carnival-0.0.44 vs app/views/carnival/shared/form/_inner_form.html.haml in carnival-0.0.45
- old
+ new
@@ -7,28 +7,28 @@
.row
- line.each do |field|
- nested_in = nil unless nested_in
- if field.nested_form?
.nested-form{:class => field.name}
-
+
%h3.nested-form-title
= t("activerecord.attributes.#{@model_presenter.full_model_name}.#{field.name}")
.nested-form-actions
= link_to_function t("nested_form.close"), "toggleNestedForm(this);"
- if field.nested_form_modes?(:new)
= " | "
= link_to_function t("nested_form.new"), "createNewForm('.nested-form-list.#{field.name}', '#{field.name}')"
-
+
- if field.nested_form_modes?(:associate)
= " | "
= link_to_function t("nested_form.existing_option"), "renderSelectOptions('.existing-options.#{field.name}')"
.existing-options{:class => field.name}
%h4.existing-options-title
= t("nested_form.existing_option_title")
- field_presenter = model_presenter.presenter_to_field(field, nil)
- = f.collection_check_boxes "#{field.name.singularize.to_sym}_ids".to_sym, field_presenter.model_class.send("all"), :id, field_presenter.model_class.to_label_options
+ = f.collection_check_boxes "#{field.name.singularize.to_sym}_ids".to_sym, field_presenter.model_class.list_for_checkbox, :first, :last
%ul.nested-form-list{:class => field.name}
%h4.nested-form-subtitle
= t("nested_form.new_subtitle")
- model_object.send(field.name).build