Sha256: 188cb319388404ef505d98c8095ac10c80aeffd933d03337c6484702b6c4105d

Contents?: true

Size: 1.71 KB

Versions: 2

Compression:

Stored size: 1.71 KB

Contents

        <div id="content-main">
        <%= form_for(@object, :action => slice_url(:admin_create, :model_name => @abstract_model.singular_name)) do %>
          <div>
            <fieldset class="module aligned">
              <% belongs_to_keys = @abstract_model.belongs_to_associations.map{|b| b[:child_key].first} %>
              <% @properties.each do |property| %>
              <% next if [:id, :created_at, :created_on, :deleted_at, :updated_at, :updated_on, :deleted_on].include?(property[:name]) %>
              <% next if belongs_to_keys.include?(property[:name]) %>
              <div class="<%= @object.errors[property[:name]] ? "form-row errors" : "form-row"%>">
                <% if @object.errors[property[:name]] %>
                <ul class="errorlist">
                  <% @object.errors[property[:name]].each do |error| %>
                  <li><%= error %></li>
                  <% end %>
                </ul>
                <% end %>
<%= partial(property[:type].to_s, :property => property) -%>
              </div>
              <% end %>
            </fieldset>
            <% @abstract_model.belongs_to_associations.each do |association| %>
<%= partial('belongs_to', :association => association) -%>
            <% end %>
            <% @abstract_model.has_many_associations.each do |association| %>
<%= partial('has_many', :association => association) -%>
            <% end %>
            <div class="submit-row" >
              <%= submit "Save", :class => "default", :name => "_save" %>
              <%= submit "Save and add another", :name => "_add_another" %>
              <%= submit "Save and continue editing", :name => "_continue" %>
            </div>
          </div>
        <% end =%>

        </div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sferik-merb-admin-0.3.0 app/views/main/new.html.erb
sferik-merb-admin-0.3.1 app/views/main/new.html.erb