Files
grecia/app/components/admin/table_actions_component.html.erb
Javi Martín 64b0cc741b Improve table actions layout
In the past we were using some <div> tags surrounding table action
links in order to guarantee these links wouldn't be wider that their
cell's space and wouldn't expand over two lines.

However, while these links didn't expand over two lines, at certain
resolutions the width of their text exceeded the width of the links,
causing part of the text to be outside their borders.

This behavior was also inconsistent: some tables had these <div> tags,
and some tables didn't.

Since we've now introduced the table actions component, the code is more
consistent and we're getting rid of these <div> tags. So now we're again
facing the issue where links could expand over two lines.

Using a flex layout solves this issue and considerably improves the
layout at lower resolutions.
2020-10-21 13:19:52 +02:00

12 lines
268 B
Plaintext

<div class="table-actions">
<%= content %>
<% if actions.include?(:edit) %>
<%= link_to edit_text, edit_path, edit_options %>
<% end %>
<% if actions.include?(:destroy) %>
<%= link_to destroy_text, destroy_path, destroy_options %>
<% end %>
</div>