Module: HierarchicalPageTitles::ViewHelpers
- Includes:
- SharedMethods
- Defined in:
- lib/hierarchical_page_titles/view_helpers.rb
Instance Method Summary (collapse)
-
- (Object) page_title(*args)
Call this in your view with a string to set the page title to that string.
-
- (Boolean) page_title?
TODO: Document.
-
- (Boolean) page_title_set?
TODO: Document.
-
- (Boolean) title_set?
TODO: Document.
-
- (Object) window_title(*args, &block)
Call this in your view with a string to add the string to the array of window titles.
-
- (Boolean) window_title_set?
TODO: Document.
Methods included from SharedMethods
Instance Method Details
- (Object) page_title(*args)
Call this in your view with a string to set the page title to that string. Call this in your layout with no arguments to output the page title.
24 25 26 27 28 29 30 31 |
# File 'lib/hierarchical_page_titles/view_helpers.rb', line 24 def page_title(*args) = args. if args.empty? @_page_title else super end end |
- (Boolean) page_title?
TODO: Document
34 35 36 |
# File 'lib/hierarchical_page_titles/view_helpers.rb', line 34 def page_title? @_page_title.present? end |
- (Boolean) page_title_set?
TODO: Document
44 45 46 |
# File 'lib/hierarchical_page_titles/view_helpers.rb', line 44 def page_title_set? @_window_title_set end |
- (Boolean) title_set?
TODO: Document
49 50 51 |
# File 'lib/hierarchical_page_titles/view_helpers.rb', line 49 def title_set? @_title_set end |
- (Object) window_title(*args, &block)
Call this in your view with a string to add the string to the array of window titles. Call this in your layout to output the window title. You can specify a separator that should be put between the titles by passing :separator => " - ".
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hierarchical_page_titles/view_helpers.rb', line 10 def window_title(*args, &block) = args. if args.empty? [:separator] ||= " - " @_window_titles ||= [] prefix = Array([:prefix]) || [] (prefix + @_window_titles).join([:separator]) else super end end |
- (Boolean) window_title_set?
TODO: Document
39 40 41 |
# File 'lib/hierarchical_page_titles/view_helpers.rb', line 39 def window_title_set? @_window_title_set end |