- unless post.errors.empty? .alert.alert-danger %h4= t('.errors.title') %p= t('.errors.help') -# TODO: habilitar form_for :ruby if post.new? url = site_posts_path(site, locale: @locale) method = :post else url = site_post_path(site, post.id, locale: @locale) method = :patch end - dir = t("locales.#{@locale}.dir") -# Comienza el formulario = form_tag url, method: method, class: 'form post', multipart: true do -# Botones de guardado = render 'posts/submit', site: site, post: post = hidden_field_tag 'post[layout]', post.layout.name -# Dibuja cada atributo - post.attributes.each do |attribute| - metadata = post.send(attribute) - type = metadata.type = render("posts/attributes/#{type}", post: post, attribute: attribute, metadata: metadata, site: site, dir: dir, locale: @locale, autofocus: (post.attributes.first == attribute)) -# Botones de guardado = render 'posts/submit', site: site, post: post