Sha256: 39276b2d248bd01b1829234802bf5351ed6f02037306bcc5fb785061021bfe43

Contents?: true

Size: 1.43 KB

Versions: 8

Compression:

Stored size: 1.43 KB

Contents

<%%= render(Tables::TableComponent.new) do |table| %>
  <%% table.with_thead do |thead| %>
  <%- bo_model.column_names.each do |column| -%>
    <%%= thead.with_active_record_th(column_name: '<%= column %>',  ransack_object: @q) %>
  <%- end -%>
    <%%= thead.with_active_record_th(column_name: '',  ransack_object: @q) %>
    <%%= thead.with_active_record_th(column_name: '',  ransack_object: @q) %>
  <%% end %>

  <%% table.with_tbody do |tbody| %>
    <%% @<%= class_name.underscore.pluralize %>&.each_with_index do |<%= class_name.underscore %>, i| %>
      <%%= tbody.with_tr(index: i) do |tr| %>
        <%- bo_model.column_names.each do |column| -%>
          <%%= tr.with_td { <%= class_name.underscore %>.<%= column %>.to_s } %>
        <%- end -%>
        <%%= tr.with_td do %>
          <%%= link_to <%="#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%>, class: "text-tybo-600 hover:text-tybo-900"  do %>
            <%%= I18n.t('bo.show') %>
          <%% end %>
        <%% end %>
        <%%= tr.with_td do %>
          <%%= link_to <%="#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%>,
          class: "text-tybo-600 hover:text-tybo-900",
          data: { turbo_method: :delete, turbo_confirm: I18n.t('bo.confirm_delete') } do %>
            <%%= render(Icons::TrashComponent.new) %>
          <%% end %>
        <%% end %>
      <%% end %>
    <%% end %>
  <%% end %>
<%% end %>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tybo-0.3.20 lib/generators/bo/templates/_table.html.erb
tybo-0.3.19 lib/generators/bo/templates/_table.html.erb
tybo-0.3.18 lib/generators/bo/templates/_table.html.erb
tybo-0.3.17 lib/generators/bo/templates/_table.html.erb
tybo-0.3.16 lib/generators/bo/templates/_table.html.erb
tybo-0.3.15 lib/generators/bo/templates/_table.html.erb
tybo-0.3.14 lib/generators/bo/templates/_table.html.erb
tybo-0.3.13 lib/generators/bo/templates/_table.html.erb