Sha256: 8f7b19b1a02a92fc2d10b74ac4d943ad28938bbe57727deaa488d3edb305bce3

Contents?: true

Size: 334 Bytes

Versions: 6

Compression:

Stored size: 334 Bytes

Contents

# frozen_string_literal: true

module RailsMiniProfiler
  module ApplicationHelper
    def present(model, presenter_class = nil, **kwargs)
      klass = presenter_class || "#{model.class}Presenter".constantize
      presenter = klass.new(model, self, **kwargs)
      yield(presenter) if block_given?
      presenter
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_mini_profiler-0.2.1 app/helpers/rails_mini_profiler/application_helper.rb
rails_mini_profiler-0.2.0 app/helpers/rails_mini_profiler/application_helper.rb
rails_mini_profiler-0.1.3 app/helpers/rails_mini_profiler/application_helper.rb
rails_mini_profiler-0.1.2 app/helpers/rails_mini_profiler/application_helper.rb
rails_mini_profiler-0.1.1 app/helpers/rails_mini_profiler/application_helper.rb
rails_mini_profiler-0.1.0 app/helpers/rails_mini_profiler/application_helper.rb