Sha256: b17dbafde70fb3b900addaef85ace0ae36e2fb356fe41108bf49b766688bff25

Contents?: true

Size: 1.93 KB

Versions: 1

Compression:

Stored size: 1.93 KB

Contents

<div class="modal-dialog modal-lg" role="document">
  <div class="modal-content">
    <%= form_for [:slash_admin, class_name_from_association(f.object, a).constantize.new], remote: true, html: {'data-type': 'json'} do |fs| %>
      <div class="modal-header">
        <%= t('slash_admin.view.create') %>
        <%= class_name_from_association(f.object, a).constantize.model_name.human.downcase %>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="errors-json"></div>
        <%= render 'slash_admin/shared/errors_data_new' %>
        <% if @model.id.blank? %>
          <% if a.is_a?(Hash) %>
            <% params_assoc = "SlashAdmin::Models::#{class_name_from_association(f.object, a).pluralize}Controller".constantize.new.create_params(from: @model_class).each %>
          <% else %>
            <% params_assoc = "SlashAdmin::Models::#{a.to_s.classify.pluralize}Controller".constantize.new.create_params(from: @model_class).each %>
          <% end %>
          <% else %>
          <% if a.is_a?(Hash) %>
            <% params_assoc = "SlashAdmin::Models::#{class_name_from_association(f.object, a).pluralize}Controller".constantize.new.update_params(from: @model_class).each %>
          <% else %>
            <% params_assoc = "SlashAdmin::Models::#{a.to_s.classify.pluralize}Controller".constantize.new.update_params(from: @model_class).each %>
          <% end %>
        <% end %>
        <% params_assoc.each do |attribute| %>
          <%= render 'slash_admin/fields/form_group', f: fs, a: attribute %>
        <% end %>
      </div>
      <div class="modal-footer">
        <a href="#" data-dismiss="modal"><%= t('slash_admin.view.cancel') %></a>
        <button type="submit" class="btn btn-primary pull-right"><%= t('slash_admin.view.save') %></button>
      </div>
    <% end %>
  </div>
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slash_admin-0.1.0 app/views/slash_admin/base/_data_belongs_to.html.erb