Sha256: fc1732a9ed476c692e6ce82c9171b9cd6955033b260bab436f5c92c101581a2a

Contents?: true

Size: 947 Bytes

Versions: 10

Compression:

Stored size: 947 Bytes

Contents

%w[InboundRequestLog OutboundRequestLog].each do |logging_model|
  config.model logging_model do
    list do
      filters %i[method path response_code request_body response_body created_at]
      scopes [nil, :failed]

      include_fields :method, :path, :response_code, :created_at

      field :request_body, :string do
        visible false
        searchable true
        filterable true
      end

      field :response_body, :string do
        visible false
        searchable true
        filterable true
      end
    end

    show do
      include_fields :loggable, :method, :path, :response_code
      field(:created_at)
      field(:request_body) do
        formatted_value { "<pre>#{JSON.pretty_generate(bindings[:object].request_body)}</pre>".html_safe }
      end
      field(:response_body) do
        formatted_value { "<pre>#{JSON.pretty_generate(bindings[:object].response_body)}</pre>".html_safe }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails_api_logger-0.4.1 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.4.0 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.3.0 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.2.5 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.2.4 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.2.3 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.2.2 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.2.1 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.2.0 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb
rails_api_logger-0.1.1 lib/rails_api_logger/rails_api_logger_rails_admin_configuration.rb