% content_for :modal_footer do %> <% end %> <%= simple_form_for( resource, url: resource.new_record? ? page_modules_path : page_module_path(resource), wrapper: :horizontal_form, method: resource.new_record? ? :post : :put, remote: request.xhr?, html: { class: 'form-horizontal', autocomplete: 'off' } ) do |f| %> <% if request.xhr? %> <% content_for :modal_body do %> <%= render partial: 'page_modules/fields', locals: { f: f } %> <% end %> <%= render partial: 'shared/layouts/modal' %> <% else %> <%= render partial: 'page_modules/fields', locals: { f: f } %>