Sha256: 52539b9eae05bc6e8a28357999fb67fc0d222fd25755c8f8598487ad6b7eb7e7

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 KB

Contents

<% if @registro.nil? %>
  <% return %>
<% end %>
<%= simple_form_for @registro, 
  url: modelo_path(@registro),
  html: @encform_html.nil? ? {} : @encform_html,
  defaults: { input_html: { class: 'span10' } } do |f| 
%>
  <%= render partial: 'msip/hogar/errores', locals: { f: f } %> 

  <% atributos_form.each do |atr|  %>
    <% vatr = atr.to_s.gsub(/[^a-z_A-Z0-9]/, '') %>
    <% rutavatr = clase.pluralize.underscore + "/campo_#{vatr}" %>
    <% (ri, rm, rd)=clase.pluralize.underscore.rpartition("/") %>
    <% radmin = "#{ri}/admin/#{rd}/campo_#{vatr}" %>
    <% #byebug %>
    <% if lookup_context.find_all(rutavatr, [], true).any? %>
      <% # Hay un parcial especifico %>
      <%= render partial: rutavatr, locals: {f: f} %>
    <% elsif lookup_context.find_all(radmin, [], true).any? %>
      <% # Hay un parcial especifico %>
      <%= render partial: radmin, locals: {f: f} %>
    <% elsif lookup_context.find_all("msip/modelos/#{vatr}", [], true).any? %>
      <% # Hay un parcial generico %>
      <%= render partial: "msip/modelos/#{vatr}", locals: {f: f} %>
    <% elsif lookup_context.find_all("msip/modelos/campo_#{vatr}", [], true).any? %>
      <% # Hay un parcial generico %>
      <%= render partial: "msip/modelos/campo_#{vatr}", locals: {f: f} %>
    <%else # Se genera el campo automaticamente %>
      <%= render partial: 'msip_campo_aut', locals: {f: f, atr: atr} %>
    <% end %>
  <% end %>

  <%= render partial: 'form_pie', locals: {clase: clase, f: f} %>
 
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
msip-2.2.0.alfa3 app/views/msip/modelos/_form.html.erb
msip-2.2.0.alfa2 app/views/msip/modelos/_form.html.erb
msip-2.2a2 app/views/msip/modelos/_form.html.erb