Sha256: b1e4b966b2ded8c035542a87ff7bae51a6d10cb9040f4051f55901c8b88e495c

Contents?: true

Size: 1.28 KB

Versions: 18

Compression:

Stored size: 1.28 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 -%>
  <%% 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

18 entries across 18 versions & 1 rubygems

Version Path
tybo-0.3.12 lib/generators/bo/templates/_table.html.erb
tybo-0.3.11 lib/generators/bo/templates/_table.html.erb
tybo-0.3.10 lib/generators/bo/templates/_table.html.erb
tybo-0.3.9 lib/generators/bo/templates/_table.html.erb
tybo-0.3.8 lib/generators/bo/templates/_table.html.erb
tybo-0.3.7 lib/generators/bo/templates/_table.html.erb
tybo-0.3.6 lib/generators/bo/templates/_table.html.erb
tybo-0.3.4 lib/generators/bo/templates/_table.html.erb
tybo-0.3.3 lib/generators/bo/templates/_table.html.erb
tybo-0.3.1 lib/generators/bo/templates/_table.html.erb
tybo-0.2.6 lib/generators/bo/templates/_table.html.erb
tybo-0.2.5 lib/generators/bo/templates/_table.html.erb
tybo-0.2.4 lib/generators/bo/templates/_table.html.erb
tybo-0.2.3 lib/generators/bo/templates/_table.html.erb
tybo-0.2.2 lib/generators/bo/templates/_table.html.erb
tybo-0.2.0 lib/generators/bo/templates/_table.html.erb
tybo-0.1.2 lib/generators/bo/templates/_table.html.erb
tybo-0.1.0 lib/generators/bo/templates/_table.html.erb