Sha256: 8adfc5532c74365f27fd890eb57c1071d4806c9356f0a3ef36b1c5ece31e2477

Contents?: true

Size: 1.8 KB

Versions: 4

Compression:

Stored size: 1.8 KB

Contents

<div class='top_block col-md-12'>
  <h3 class='pull-left'><%= @model_class %></h3>

  <div class='pull-right'>
    <b><%= link_to 'Add new Record', model_new_path(model_class: @model_class), class: 'btn btn-success' %></b>
  </div>
</div>

<table class='table table-hover'>
  <tr>
    <% model_column_names.each do |column_name| %>
        <th><%= column_name %></th>
    <% end %>
    <th>Actions</th>
    <th>Association Relationship</th>
  </tr>
  <% @model_pagination.each do |model_data| %>
      <tr>
        <% model_column_names.each do |model_column_name| %>
            <td>
              <%= model_column_value(model_data, model_column_name) %>
            </td>
        <% end %>
        <%= model_actions(model_data) %>
        <td>
          <% if associations_hash.empty? %>
              <%= "Sorry no association exist for #{@model_class}" %>
          <% else %>
              <% associations_hash.each do |association_name_and_macro, model_class| %>
                  <%= link_to "#{association_name_and_macro.last} #{association_name_and_macro.first} |",
                              associations_index_path(associated_model_name: association_name_and_macro.first,
                                                      model_object_id: model_data.id,
                                                      model_class: @model_class,
                                                      associated_model_class: model_class,
                                                      macro: association_name_and_macro.last) %>
              <% end %>
          <% end %>
        </td>
      </tr>
  <% end %>
</table>

<%= model_download_actions %>

<nav>
  <ul class='pagination'>
    <li><%= paginate @model_pagination %></li>
    <%= rel_next_prev_link_tags @model_pagination unless @model_pagination.empty? %>
  </ul>
</nav>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
model_info-1.0.0 app/views/model_info/models/index.html.erb
model_info-0.0.9 app/views/model_info/models/index.html.erb
model_info-0.0.8 app/views/model_info/models/display.html.erb
model_info-0.0.7 app/views/model_info/models/display.html.erb