Sha256: 1a14f3345bc81e98c3726447b6916631f100e085fcd9ab5d9759ad91af2ec9ab

Contents?: true

Size: 1.61 KB

Versions: 145

Compression:

Stored size: 1.61 KB

Contents

This goes in _new.html.erb
      <% if form_element.to_sym == :associated  -%>
        <% @nested_model = @object.send(attribute) %>
        <%= render 'new_nested' %>
      <% end %>
********

<% @nested_object = @nested_model.build %>

<div class="new_nested_record">
  <div class="row" >
    <div class="large-12 column object_presentation" >
      <%= t('inline_forms.view.add_new', :model => @nested_object.class ) -%>
    </div>
  </div>
    <% nested_attributes = @nested_object.inline_forms_attribute_list -%>
    <% nested_attributes.each do | nested_attribute, nested_name, nested_form_element | -%>
    <% @nested_form_element = nested_form_element %>
    <% @nested_attribute = nested_attribute %>
      <% unless @nested_form_element.to_sym == :associated -%>
        <% if @nested_form_element == :header %>
          <div class="row form_element_header" >
            <div class='large-12 column' >
              <%= @nested_object.class.human_attribute_name(@nested_attribute) -%>
            </div>
          </div>
        <% else %>
          <div class="row <%= cycle('odd', 'even') %>">
            <div class='medium-3 large-3 column' >
              <%= @nested_object.class.human_attribute_name(@nested_attribute) -%>
            </div>
            <div class='medium-9 large-9 column' >
              <%= send("#{@nested_form_element}_edit", @nested_object, @nested_attribute) -%>
            </div>
          </div>
        <% end -%>
      <% end -%>
    <% end -%>
    <% if @nested_form_element.to_sym == :associated  -%>
      <%= render 'new_nested' %>
    <% end %>
    <div class="row record_footer"></div>
</div>

Version data entries

145 entries across 145 versions & 1 rubygems

Version Path
inline_forms-6.2.14 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.12 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.11 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.10 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.9 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.7 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.6 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.5 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.4 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.3 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.2 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.2.1 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.1.1 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.1.0 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.0.8 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.0.7 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.0.6 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.0.5 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.0.4 app/views/inline_forms/_new_nested.html.erb
inline_forms-6.0.3 app/views/inline_forms/_new_nested.html.erb