Module: Mensa::Config

Defined in:
app/tables/mensa/config/table_dsl.rb,
app/tables/mensa/config/dsl_logic.rb,
app/tables/mensa/config/action_dsl.rb,
app/tables/mensa/config/column_dsl.rb,
app/tables/mensa/config/filter_dsl.rb,
app/tables/mensa/config/render_dsl.rb

Overview

class UsersTable < Mensa::Base

definition do
  model User

  render do # default Standard components
    html # Mensa::TableComponent::Default
    json # Mensa::JsonRenderer::Default
    xlsx # Mensa::XlsxRenderer::Default
  end

  column(:first_name) do
    filter
    # render do
    #   html do |c|
    #     link_to(edit_contact_path(c)) do
    #       content_tag("i", nil, class: "fal fa-book")
    #     end
    #   end
    # end
  end
  column :last_name do
    filter
  end
  column :email
  column :phone_number
  column :state
  column :city
  column :created_at

  order last_name: :asc
  link { |user| edit_user_path(user) }

  supports_views true
  supports_filters true

  action :activate do
    link { |user| edit_user_path(user) }
    icon "fa-check"
  end
  action :delete do
    link { |user| edit_user_path(user) }
    link_attributes "data-turbo-method" => "delete"
    icon "fa-xmark"
  end
end

Defined Under Namespace

Modules: DslLogic Classes: ActionDsl, ColumnDsl, FilterDsl, RenderDsl, TableDsl