Class: Footnotes::Notes::ParamsNote
- Inherits:
-
AbstractNote
- Object
- AbstractNote
- Footnotes::Notes::ParamsNote
- Defined in:
- lib/rails-footnotes/notes/params_note.rb
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(controller) ⇒ ParamsNote
constructor
A new instance of ParamsNote.
- #title ⇒ Object
Methods inherited from AbstractNote
close!, #escape, #has_fieldset?, #hash_to_xml_attributes, included?, #javascript, #legend, #link, #mount_table, #mount_table_for_hash, #onclick, #prefix?, #row, start!, #stylesheet, title, #to_sym, to_sym, #valid?
Constructor Details
#initialize(controller) ⇒ ParamsNote
Returns a new instance of ParamsNote.
4 5 6 7 8 9 10 |
# File 'lib/rails-footnotes/notes/params_note.rb', line 4 def initialize(controller) @params = if Rails::VERSION::MAJOR >= 5 controller.params.to_unsafe_h else controller.params end end |
Instance Method Details
#content ⇒ Object
16 17 18 |
# File 'lib/rails-footnotes/notes/params_note.rb', line 16 def content mount_table_for_hash(@params, :summary => "Debug information for #{title}") end |
#title ⇒ Object
12 13 14 |
# File 'lib/rails-footnotes/notes/params_note.rb', line 12 def title "Params (#{@params.length})" end |