Sha256: 64e4ab69a77452d0f4204399cb38288af1f86733024da48cb92832bd194a9648

Contents?: true

Size: 887 Bytes

Versions: 25

Compression:

Stored size: 887 Bytes

Contents

<%= f.label a, class: 'form-control-label label-has-one' %>
<%= render 'slash_admin/shared/tooltip', a: a %>

<% if f.object.send(a).blank? %>
  <% f.object.send("#{a.to_s}=", a.to_s.classify.constantize.new) %>
<% end %>

<%= f.fields_for a do |association_form| %>
  <% if f.object.id.blank? %>
    <% method = 'create_params' %>
  <% else %>
    <% method = 'update_params' %>
  <% end %>

  <% if a.is_a?(Hash) %>
    <% params_assoc = "SlashAdmin::Models::#{class_name_from_association(f.object, a).pluralize}Controller".constantize.new.send(method, from: @model_class) %>
  <% else %>
    <% params_assoc = "SlashAdmin::Models::#{a.to_s.classify.pluralize}Controller".constantize.new.send(method, from: @model_class) %>
  <% end %>

  <% params_assoc.each do |attribute| %>
    <%= render 'slash_admin/fields/form_group', f: association_form, a: attribute %>
  <% end %>
<% end %>

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
slash_admin-1.5.11 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.10 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.9 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.8 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.7 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.6 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.5 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.4 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.3 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.2 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5.1 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.5 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.4.1 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.4 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.3.5 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.3.4 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.3.3 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.3.2 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.3.1 app/views/slash_admin/fields/_nested_has_one.html.erb
slash_admin-1.3.0 app/views/slash_admin/fields/_nested_has_one.html.erb