Method: Pageflow::HelpEntries#register
- Defined in:
- lib/pageflow/help_entries.rb
#register(name, options = {}) ⇒ Object
Add a section to the help dialog displayed in the editor.
Translation keys for the help entry are derived from its name by appending “.menu_item” and “.text”. Text is parsed as markdown.
20 21 22 23 24 25 26 27 28 |
# File 'lib/pageflow/help_entries.rb', line 20 def register(name, = {}) help_entry = HelpEntry.new(name, ) @help_entries_by_name[name] = help_entry collection = find_collection([:parent]) collection << help_entry collection.sort_by! { |help_entry| -help_entry.priority } end |