<%%- cache(element) do -%> <%%= element_view_for(element) do |el| -%> <%% privacy_link = element.content_by_name(:privacy_page).essence.link privacy_title = element.content_by_name(:privacy_page).essence.body @<%= name.underscore.singularize %> = <%= name.singularize.classify %>.new @<%= name.underscore.singularize %>.alcm_element = element.id %>
<%%= form_for(@<%= name.underscore.singularize %>, url: main_app.<%= name.underscore.pluralize %>_path, method: :post, multipart: true,html:{class: "ajax_forms"}) do |f| %> <%%= f.hidden_field :alcm_element %>
<% attributes.each do |attr| %>
<%%= f.<%=attr.field_type.to_s%> :<%= attr.name %> %>
<% end %>
<%% if !privacy_title.blank? %>
<%%= f.check_box :check_privacy %> <%%= link_to privacy_link do %> <%% end %>
<%% else %> <%%= f.check_box :check_privacy %> <%% end %>
<%%= f.submit t(:submit), data: {disable_with: false} %>
<%% end %> <%%- end -%> <%%- end -%>