Skip to content
Snippets Groups Projects
Commit 6e20dcec authored by Matheus Agio Nerone's avatar Matheus Agio Nerone
Browse files

improving view and preventing n+1 queries


Signed-off-by: default avatarman13 <man13@inf.ufpr.br>
parent 0bf93a74
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ class Management::ObjectTypesController < ManagementController ...@@ -4,7 +4,7 @@ class Management::ObjectTypesController < ManagementController
# GET /management/object_types # GET /management/object_types
# GET /management/object_types.json # GET /management/object_types.json
def index def index
@object_types = ::ObjectType.all @object_types = ::ObjectType.includes(:mime_types).all
end end
# GET /management/object_types/new # GET /management/object_types/new
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<thead> <thead>
<tr> <tr>
<th>Nome</th> <th>Nome</th>
<th>MimeTypes</th>
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
<% @object_types.each do |object_type| %> <% @object_types.each do |object_type| %>
<tr> <tr>
<td><%= object_type.name %></td> <td><%= object_type.name %></td>
<td><%= object_type.mime_types.to_a %></td>
<td class="ls-txt-right ls-regroup"><%= link_to 'Editar', edit_management_object_type_path(object_type) %> <td class="ls-txt-right ls-regroup"><%= link_to 'Editar', edit_management_object_type_path(object_type) %>
<td> <td>
<% if show_delete_button? object_type %> <% if show_delete_button? object_type %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment