Sha256: 510c5e5d6d5d2cabd2b744341c04a61b2d6b6d3916f77292e528389471bd074c

Contents?: true

Size: 447 Bytes

Versions: 8

Compression:

Stored size: 447 Bytes

Contents

module Footnotes
  module Notes
    class ParamsNote < AbstractNote
      def initialize(controller)
        @params = if Rails::VERSION::MAJOR >= 5
          controller.params.to_unsafe_h
        else
          controller.params
        end
      end

      def title
        "Params (#{@params.length})"
      end

      def content
        mount_table_for_hash(@params, :summary => "Debug information for #{title}")
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rails-footnotes-7.1.0 lib/rails-footnotes/notes/params_note.rb
rails-footnotes-7.0.1 lib/rails-footnotes/notes/params_note.rb
rails-footnotes-7.0.0 lib/rails-footnotes/notes/params_note.rb
rails-footnotes-5.0.0 lib/rails-footnotes/notes/params_note.rb
rails6-footnotes-5.0.2 lib/rails-footnotes/notes/params_note.rb
rails6-footnotes-5.0.1 lib/rails-footnotes/notes/params_note.rb
rails6-footnotes-5.0.0 lib/rails-footnotes/notes/params_note.rb
rails-footnotes-4.1.8 lib/rails-footnotes/notes/params_note.rb